hello,
I have question about the re.I option for Regular Expressions:
[color=blue][color=green][color=darkred]
>>> import re
>>> re.findall('x', '1x2X3', re.I)[/color][/color][/color]
['x', 'X']
as expected finds both lower and uppercase x
[color=blue][color=green][color=darkred]
>>> re.split('x', '1x2X3', re.I)[/color][/color][/color]
['1', '2X3'][color=blue][color=green][color=darkred]
>>> re.split('x', '1x2X3')[/color][/color][/color]
['1', '2X3']
I expected ['1', '2', '3'] but in this case re.I bahaves exactly as not
present at all...
Is that an expected behaviour or a fault?
Running Python 2.4.1 on Windows XP
thanks for any hint
chris
I have question about the re.I option for Regular Expressions:
[color=blue][color=green][color=darkred]
>>> import re
>>> re.findall('x', '1x2X3', re.I)[/color][/color][/color]
['x', 'X']
as expected finds both lower and uppercase x
[color=blue][color=green][color=darkred]
>>> re.split('x', '1x2X3', re.I)[/color][/color][/color]
['1', '2X3'][color=blue][color=green][color=darkred]
>>> re.split('x', '1x2X3')[/color][/color][/color]
['1', '2X3']
I expected ['1', '2', '3'] but in this case re.I bahaves exactly as not
present at all...
Is that an expected behaviour or a fault?
Running Python 2.4.1 on Windows XP
thanks for any hint
chris
Comment