Open main menu

CDOT Wiki β

Changes

Automated localization build tool

186 bytes added, 18:21, 13 October 2007
m
formatting regular expressions
* An analysis of regular expression, specific to DTDs (from Parser.py)
self.key = re.compile('<!ENTITY\s+([\w\.]+)\s+(\"(?:[^\"]*\")|(?:\'[^\']*)\')\s*>', re.S)
'''\s+''' - one or more (??) blank spaces, tabs, end of line, and others whitespace elements '''([\w\.]+)''' - one or more alphanumeric characters and/or(??) a dot '''\s+''' - more of the same '''(\"(?:[^\"]*\")|(?:\'[^\']*)\')''' - difficult part if the left of '|' matches ,the right part doesn't get analyzed * ''(\"(?:[^\"]*\")'' - matching something in between " and " * (?:[^\"]* \") - '''I'M NOT SURE OF THIS PART'''everything after "?:" if matched cannot be referenced not a backslash or a " - the * indicate zero or more - RIGHT??? ''(?:\'[^\']*)\')'' - the right side of the difficult reg. expression  * '''\s*''' - none or more(??) white characters '''re.S''' - makes the dot to match even new lines - it is like raising DOTALL flag 
A matching line:
* '' "<!ENTITY colorsDialog.title "Colors">''"
=== Related regular expressions theory ===
1
edit