Message811

Author trelony
Recipients
Date 2003-01-14.23:19:18
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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#'
History
Date User Action Args
2008-02-20 17:17:13adminlinkissue668194 messages
2008-02-20 17:17:13admincreate