re.rsearch?

Fredrik Lundh fredrik at pythonware.com
Sun Jun 23 18:10:01 EDT 2002


Quinn Dunkan wrote:
> Occaisionally I find myself wanting an re.search that will find the rightmost
> match.

just prepend ".*" to the pattern...

> Unfortunately, AFAIK, re.search also lacks a 'start_searching_at'
> type option.

if you use a compiled pattern, you can pass in start
and end offsets:

    p = re.compile(pattern)
    p.search(string, start, end)

</F>





More information about the Python-list mailing list