Hello,

consider the following code

 >>> re.search("[a-z](?i)[a-z]","AA")
<_sre.SRE_Match object at 0x40177e20>

this gives a match
if we provide an extra group for the first character it still works

 >>> re.search("([a-z])(?i)[a-z]","AA").group(1)
'A'
 >>>

it doesn't matter where (?i) is placed, right?
the re engine would glance at once on the entire pattern string
analize it (complain if pattern doesn't make sense, eg invalid)
and it would be the same as if the option was given expicitely
as re.IGNORECASE.

Is there a way to switch-off the option resp.
switch-on the option in the middle of the pattern?

Regards, Daniel
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to