Re: re module methods: flags(), pattern()

2005-04-18 Thread Andrà SÃreng
A flag is just an int. From the re doc, you can see there is a ignorecase flag: " I IGNORECASE Perform case-insensitive matching; expressions like [A-Z] will match lowercase letters, too. This is not affected by the current locale. " Using the ignorecase flag: >>> import re >>> print re.I 2 >

Re: re module methods: flags(), pattern()

2005-04-17 Thread Kay Schluehr
Xah Lee wrote: > Python re module has methods flags and pattern. How to use these > exactly? >From the Python 2.3 documentation, section 2.4.2 flags The flags argument used when the RE object was compiled, or 0 if no flags were provided. groupindex A dictionary mapping any symbolic group name

Re: re module methods: flags(), pattern()

2005-04-17 Thread Reinhold Birkenfeld
Xah Lee wrote: > Python re module has methods flags and pattern. How to use these > exactly? > > e.g. i tried > > print patternObj.flags() > > and the error is some "int object is not callable". Where do you read "methods"? Reinhold -- http://mail.python.org/mailman/listinfo/python-list

re module methods: flags(), pattern()

2005-04-17 Thread Xah Lee
Python re module has methods flags and pattern. How to use these exactly? e.g. i tried print patternObj.flags() and the error is some "int object is not callable". newpattern=re.compile(ur'\w+',patternObj.flags()) also bad. similar error for patternObj.pattern(). (and i suppose the same for g