[Assorted-commits] SF.net SVN: assorted:[1046] sandbox/trunk/src/py/string_literal_regex.py
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-11-01 21:41:39
|
Revision: 1046 http://assorted.svn.sourceforge.net/assorted/?rev=1046&view=rev Author: yangzhang Date: 2008-11-01 21:37:51 +0000 (Sat, 01 Nov 2008) Log Message: ----------- updated string literal regex demo Modified Paths: -------------- sandbox/trunk/src/py/string_literal_regex.py Modified: sandbox/trunk/src/py/string_literal_regex.py =================================================================== --- sandbox/trunk/src/py/string_literal_regex.py 2008-11-01 19:37:03 UTC (rev 1045) +++ sandbox/trunk/src/py/string_literal_regex.py 2008-11-01 21:37:51 UTC (rev 1046) @@ -3,4 +3,4 @@ pat = r'"((?:[^"\\]|\\.)*)"|((?:[^\\\s]|\\.)+)(?:\s+|\s*$)' for m in finditer(pat, target): [x] = [x for x in m.groups() if x is not None] - print sub(r'\\(.)', r'\1', x.strip('"')) + print sub(r'\\(.)', r'\1', x) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |