From: Andrew Dalke (adalke_at_mindspring.com)
Date: Tue Apr 30 2002 - 20:38:10 CDT

jen ramus:
>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.

Are you sure you are testing this correctly? Here's what I get
>>> from re import *
>>> prog = compile('.*f$')
>>> print prog.match('aaafbbb')
None
>>> print prog.match('f')
<_sre.SRE_Match object at 0x12028d7b0>
>>>

Could you copy&paste your full interactive session?

                    Andrew
                    dalke_at_dalkescientific.com