Files
codeql/python/ql/src/Expressions/Regex/MissingPartSpecialGroup.py
2018-11-19 15:10:42 +00:00

10 lines
252 B
Python

import re
matcher = re.compile(r'(P<name>[\w]+)')
def only_letters(text):
m = matcher.match(text)
if m:
print("Letters are: " + m.group('name'))
#Fix the pattern by adding the missing '?'
fixed_matcher = re.compile(r'(?P<name>[\w]+)')