re.match question

Thomas Svensson thomas.svensson at era.ericsson.se
Thu Oct 5 11:34:20 EDT 2000


Hello,

I'm matching a list of strings. I want "xxxBar" to be a match but not
"xxxFooBar", xxx can be anything. I've tried the following:

re.match('^.*?(?!Foo)Bar$', word)

re.match('^.*?(Foo){0}Bar$', word)

But they all returns a match. What am I doing wrong?? I think this
should be an easy thing to do.


Thanks for any help,
Thomas



More information about the Python-list mailing list