Need a specific sort of string modification. Can someone help?

Tim Chase python.list at tim.thechases.com
Sat Jan 5 19:49:06 CET 2013


On 01/05/13 11:24, Tim Chase wrote:
>  I don't know how this version times out:
>
>     import re
>     r = re.compile(r"[-+](\d+)([^-+]*)")
>     def modify(m):
>         result = m.group(2)[int(m.group(1)):]
>         return result

Doh, I intended to change this after testing, making it just

   returm m.group(2)[int(m.group(1)):]

rather than expending an intermediate variable I used for testing

-tkc





More information about the Python-list mailing list