import re
p = re.compile("[a-z]")
for m in p.finditer('a1b2c3d4'):
print(m.start(), m.group())
More Related Contents:
- How to understand regular expression with python?
- Python regex matching Unicode properties
- Python: How to match nested parentheses with regex?
- How can I remove text within parentheses with a regex?
- python re.sub group: number after \number
- Handling backreferences to capturing groups in re.sub replacement pattern
- Python regular expressions – how to capture multiple groups from a wildcard expression?
- Named regular expression group “(?Pregexp)”: what does “P” stand for?
- Capturing group with findall?
- Strip / trim all strings of a dataframe
- Using BeautifulSoup to find a HTML tag that contains certain text
- Python re.sub question
- How to replace the first occurrence of a regular expression in Python?
- Python regular expressions OR
- Python regex for unicode capitalized words
- matching unicode characters in python regular expressions
- How to do sed like text replace with python?
- Replace a string located between
- Variable-Width Lookbehind Issue in Python
- Why isn’t the regular expression’s “non-capturing” group working?
- Python regular expression for HTML parsing
- Remove Sub String by using Python
- How does python and the regex module handle backslashes?
- How to tell if one regular expression matches a subset of another regular expression?
- How to get the first word in the string
- Generate a String that matches a RegEx in Python [duplicate]
- Split string at commas except when in bracket environment
- Using ^ to match beginning of line in Python regex
- How to split long regular expression rules to multiple lines in Python
- Python regular expression not matching