DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16461>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16461 Broken non-greedy regular expressions. Summary: Broken non-greedy regular expressions. Product: ORO Version: 2.0.6 Platform: Other OS/Version: Other Status: NEW Severity: Critical Priority: Other Component: Main AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] The problem was found in Jython by several programmers, but it looks like ORO's fault. I replaced Jython's ORO with ORO 2.0.7 - the result is the same. In the following test the first block matching ([^":]*?) contains quotas, but if expression is ([^":]*), it does not match at all. Greedy modifier cannot affect operation success. Test program: import re s='"file.name" "path/file"' s2=re.sub(r'^"([^":]*)/([^":/\\]*)"', r'1 #\1#\n2#\2#', s) s3=re.sub(r'^"([^":]*?)/([^":/\\]*)"', r'1 #\1#\n2#\2#', s) print "s='"+s+"'\n\n============================\ns2='"+s2+"'\n\n============================\ns3='"+s3+"'" output (s2 is not changed - no match; s3's first block contains quotas): s='"file.name" "path/file"' ============================ s2='"file.name" "path/file"' ============================ s3='1 #file.name" "path# 2 #file#' -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
