To add to this, in python 2.6.5 trying to do this raises an error:

>
>Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) 
>[GCC 4.4.3] on linux2
>Type "help", "copyright", "credits" or "license" for more information.
>>>> import re
>>>> comp = re.compile('a')
>>>> re.match(comp, 'A', re.I)
>Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/usr/lib/python2.6/re.py", line 137, in match
>    return _compile(pattern, flags).match(string)
>  File "/usr/lib/python2.6/re.py", line 238, in _compile
>    raise ValueError('Cannot process flags argument with a compiled pattern')
>ValueError: Cannot process flags argument with a compiled pattern
>>>> 
>
>Walter, Hugo,
>
>THANKS for your replies. I am getting my sanity back again. ;-) This is 
>another reason to stay up-to-date with software versions. I wish my company 
>upgraded to 2.7.highest and ditched all the older versions. In the future, 
>I'll also use re.compile in the way Walter describes.
>
>Albert-Jan
>
>
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to