~parthpanchl/gtg/workspace2

« back to all changes in this revision

Viewing changes to GTG/tools/urlregex.py

  • Committer: Parin Porecha
  • Date: 2014-01-31 06:59:35 UTC
  • mfrom: (1240.2.94 port-to-gtk3-py3)
  • Revision ID: parinporecha@gmail.com-20140131065935-ub6evnrwpmmm25hz
Merged the gtk3 and python3 port with GTG trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
import re
28
28
 
29
 
UTF_CHARS = ur'a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff'
 
29
UTF_CHARS = r'a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff'
30
30
 
31
31
SUBST_DICT = {
32
 
    "pre": ur'(?:[^/"\':!=]|^|\:)',
33
 
    "domain": ur'([\.-]|[^\s_\!\.\/])+\.[a-z]{2,}(?::[0-9]+)?',
34
 
    "path": ur'(?:[\.,]?[%s!\*\'\(\);:&=\+\$/%s#\[\]\-_,~@])' % (
 
32
    "pre": r'(?:[^/"\':!=]|^|\:)',
 
33
    "domain": r'([\.-]|[^\s_\!\.\/])+\.[a-z]{2,}(?::[0-9]+)?',
 
34
    "path": r'(?:[\.,]?[%s!\*\'\(\);:&=\+\$/%s#\[\]\-_,~@])' % (
35
35
    UTF_CHARS, '%'),
36
 
    "query": ur'[a-z0-9!\*\'\(\);:&=\+\$/%#\[\]\-_\.,~]',
 
36
    "query": r'[a-z0-9!\*\'\(\);:&=\+\$/%#\[\]\-_\.,~]',
37
37
    # Valid end-of-path characters (so /foo. does not gobble the period).
38
38
    "path_end": r'[%s\)=#/]' % UTF_CHARS,
39
39
    "query_end": '[a-z0-9_&=#]',