quotes at the edges of a triple quote string...

Anthony Roberts acrobert-at-ucalgary-dot-ca at ucalgary.ca
Sat May 1 12:09:42 EDT 2004


property = re.compile("""(?P<name>[a-z0-9_\-]+)="(?P<value>.*?)""""re.I)

This doesn't work because the closing quote in my regex forms the first 
quote of a triple quote to end the string...

property = re.compile("""(?P<name>[a-z0-9_\-]+)=("(?P<value>.*?)")""", re.I)

This mucks up stuff I want to do later.

I've thought about it for a while, and except for changing it to a 
single-quoted string with escaped quotes, is there any clean way to do this?

TIA,
Anthony



More information about the Python-list mailing list