From: jen ramus (vanillajava_at_yahoo.com)
Date: Tue Apr 30 2002 - 20:24:52 CDT

I can not seem to compile a regular expression that
demands a string ends with a particular character.

The simple example is

from re import *
prog = compile('.*f$')
print prog.match('aaafbbb')
<SRE_Match object at 0x97562d0>

print prog.match('f')
None

I would think that the first example would be None and
the second a match.

This is the regular expression I am working on

.*/c_5_.*[.]pdb$

I want it to match

tmp/vmd/c_5_34.pdb

and reject

tmp/vmd/c_4_34.pdb

Can anyone tell me why the simple .*f$ does not seem
to work or suggest a solution that does work for my
example.

__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com