- using the findall method of a regexp will return all matches to the regular experession as a list
- using finditer will return an iterator which you can use to interate through the matches
- if m is the result of iterator.next() then m.span() will give you the start and end indexes of the match and m.group() gives you the match
- If you have groups in the regexp e.g r"a(.*?)b" then m.group() will return the WHOLE matched expression and m.span() will return the corresponding start and stop indexes. To get just the particular group, for the expression given above, you have to do m.span(1) and m.group(1)
gattach was a handy tool to use for webmail clients like gmail. I couldn't find it anymore, but then from this discussion I found out that gattach is now affixa.
Comments
Post a Comment