Regular expression question -- exclude substring

google at fatherfrost.com google at fatherfrost.com
Mon Nov 7 19:18:14 EST 2005


Ya, for some reason your non-greedy "?" doesn't seem to be taking.
This works:

re.sub('(.*)(00.*?01) target_mark', r'\2', your_string)




More information about the Python-list mailing list