Regular Expression Groups - loop

shahargs at gmail.com shahargs at gmail.com
Tue Aug 7 09:44:49 CEST 2007


Hi,
I'm trying to write application which parse one page to sentences and
then, check every group for few things.

The code:
		rawstr = r"""([^.?!]+[.?!])"""
		regex=re.compile(rawstr)
		matchs=regex.search(document)
document, is the text i parsing. I cheked it in Kodos, and everything
worked well. but, i'm trying to write for loop which check every
group.

I tried:
		for group in matchs.groups():
but then, it's check only the first group. and i tried:
		for group in matchs.group():
but then it's checking every letter, not every sentence.

is anyone know how i should write this loop to check every group on
the groups collection that the regular expression return?

Shahar.




More information about the Python-list mailing list