Hello,
consider the following code
<_sre.SRE_Mat ch object at 0x40177e20>
this gives a match
if we provide an extra group for the first character it still works
'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
consider the following code
>>re.search("[a-z](?i)[a-z]","AA")
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 )
>>>
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
Comment