searching backwards in a string

Skip Montanaro skip at pobox.com
Tue Feb 12 22:45:39 EST 2002


    Paul> I propose adding a "direction flag" to the search function:

    Paul>    match = pattern.search(text, 50000, -1, direction=-1)

    Paul> here 50000 and -1 are the starting and ending locations.

If start > end isn't direction == -1 implied?

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list