Regular expressions help

Mike C. Fletcher mcfletch at rogers.com
Tue Feb 24 20:25:09 CET 2004


Look in the module reference for REs, particularly the expression syntax 
section:
    http://www.python.org/doc/2.3.3/lib/re-syntax.html

You probably want either the $ or \b constructs.  I'll let you decide 
which is more appropriate for your task.  You might alternately want the 
(?! ... ) construct, but that's probably more complex than your needs.

HTH,
Mike

Mike Hearne wrote:

>Given the following three lines:
>
>name fredgeorge
>name georgeharry
>name george
>
>I'm trying to find a regular expression that matches only the third
>one.
>  
>
...
_______________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://members.rogers.com/mcfletch/






More information about the Python-list mailing list