Sal
Peter Hoffmann Director Data Engineering at Blue Yonder. Python Developer, Conference Speaker, Mountaineer

Python Regex Use - How to Get Positions of Matches

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()