Newbie regex question.
Omri Schwarz
ocscwar at h-after-ocsc.mit.edu
Wed Mar 13 13:54:50 EST 2002
I have a regex = re.compile('yadda (widget1) (widget2) yadda')
and want to search a string I know to have multiple
instances of this regex. I'm a tad confused by
the RE Howto, so I'd like to ask, how do I properly
get a for loop to access the widget1 and widget2
strings of each instance?
for instance in regex.search(string).groups()
seems to be the right thing, but isn't working.
--
Omri Schwarz --- ocscwar at mit.edu ('h' before war)
Timeless wisdom of biomedical engineering: "Noise is principally
due to the presence of the patient." -- R.F. Farr
More information about the Python-list
mailing list