using target words from arrays in regex, pythons version of perls 'map'

Paddy paddy3118 at netscape.net
Tue May 16 02:15:04 EDT 2006


I don't like string interpolation within REs, it pops me out of 'RE
mode' as I scan the line.

Maybe creating a dict of matchobjects could  be used in the larger
context?:
  dict( [(t, re.search(t+regexp_tail, file2) for t in targets] )

(untested).

- Pad.




More information about the Python-list mailing list