how to check regex python code example
Example 1: check string equal with regular expression python
import re
pattern = re.compile("^([A-Z][0-9]+)+$")
pattern.match(string)
Example 2: re python3
import re
>>> m = re.search('(?<=abc)def', 'abcdef')
>>> m.group(0)
'def'