Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python loop on regexex match

import re

s = "ABC12DEF3G56HIJ7"
pattern = re.compile(r'([A-Z]+)([0-9]+)')

for m in re.finditer(pattern, s):
    print m.group(2), '*', m.group(1)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #loop #regexex #match
ADD COMMENT
Topic
Name
9+4 =