re.sub and re.MULTILINE
nyenyec
nyenyec at gmail.com
Mon Jan 8 23:17:46 EST 2007
More information about the Python-list mailing list
Mon Jan 8 23:17:46 EST 2007
- Previous message (by thread): re.sub and re.MULTILINE
- Next message (by thread): re.sub and re.MULTILINE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I feel like a complete idiot but I can't figure out why re.sub won't
match multiline strings:
This works:
>>> re.search("^foo", "\nfoo", re.MULTILINE)
<_sre.SRE_Match object at 0x6c448>
This doesn't. No replacement:
>>> re.sub("^foo", "bar", "\nfoo", re.MULTILINE)
'\nfoo'
Why?
Thanks,
nyenyec
- Previous message (by thread): re.sub and re.MULTILINE
- Next message (by thread): re.sub and re.MULTILINE
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list