Re: Regular expression for not-group

2006-06-15 Thread Chris Lasher
Man, that's a headslap-worthy overlooking of the obvious. Ha! =-) I was using the redemo.py that comes standard with Python but that Kodos app looks even neater! Thanks for the tip. Thanks Paddy. Chris -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression for not-group

2006-06-15 Thread Paddy
P.S. kodos might help you: http://kodos.sourceforge.net/ - Pad. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression for not-group

2006-06-15 Thread Paddy
Chris Lasher wrote: > Is it possible to write a regular expression such that a "match" is > found provided the string does not match a group in the regex? Let me > give a concrete example. > > Suppose I want to find a match to any filename that does not end in > .py, (ignoring the obvious use of t

Re: Regular expression for not-group

2006-06-15 Thread adam johnson
You want to use negative lookahead eg.\.(?!py)it matches only if the characters ahead in the regex don't match the pattern in the brackets. http://docs.python.org/lib/re-syntax.html (about halfway down the page)On 15 Jun 2006 14:11:39 -0700, Chris Lasher <[EMAIL PROTECTED]> wrote: Is it possible t

Regular expression for not-group

2006-06-15 Thread Chris Lasher
Is it possible to write a regular expression such that a "match" is found provided the string does not match a group in the regex? Let me give a concrete example. Suppose I want to find a match to any filename that does not end in .py, (ignoring the obvious use of the .endswith('.py') string metho