Peter Hoffmann
About
Archive
Talks
RSS Feed
Peter Hoffmann
Follow
Python Developer, Conference Speaker, Mountaineer
Python Regex Use - How to Get Positions of Matches
October 30, 2008
stackoverflow
python
This my Answer to the stackoverflow question:
Python Regex Use - How to Get Positions of Matches
:
import re p = re.compile("[a-z]") for m in p.finditer('a1b2c3d4'): print m.start(), m.group()