Rearranged patterns that are searched for; match longer ones first

svn: r15804
This commit is contained in:
Doug Blank 2010-08-22 21:25:53 +00:00
parent 638ac9c281
commit ee75d5ca5f

View File

@ -517,14 +517,14 @@ class StyledTextEditor(gtk.TextView):
self.textbuffer.create_tag('hyperlink', self.textbuffer.create_tag('hyperlink',
underline=UNDERLINE_SINGLE, underline=UNDERLINE_SINGLE,
foreground='blue') foreground='blue')
self.textbuffer.match_add(SCHEME + "//(" + USER + "@)?[" +
HOSTCHARS + ".]+" + "(:[0-9]+)?(" +
URLPATH + ")?/?", GENURL)
self.textbuffer.match_add("(www|ftp)[" + HOSTCHARS + "]*\\.[" + self.textbuffer.match_add("(www|ftp)[" + HOSTCHARS + "]*\\.[" +
HOSTCHARS + ".]+" + "(:[0-9]+)?(" + HOSTCHARS + ".]+" + "(:[0-9]+)?(" +
URLPATH + ")?/?", HTTP) URLPATH + ")?/?", HTTP)
self.textbuffer.match_add("(mailto:)?[a-z0-9][a-z0-9.-]*@[a-z0-9]" self.textbuffer.match_add("(mailto:)?[a-z0-9][a-z0-9.-]*@[a-z0-9]"
"[a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)+", MAIL) "[a-z0-9-]*(\\.[a-z0-9][a-z0-9-]*)+", MAIL)
self.textbuffer.match_add(SCHEME + "//(" + USER + "@)?[" +
HOSTCHARS + ".]+" + "(:[0-9]+)?(" +
URLPATH + ")?/?", GENURL)
def _create_spell_menu(self): def _create_spell_menu(self):
"""Create a menu with all the installed languages. """Create a menu with all the installed languages.