This should be easy for those who know regex but for some reason I can not understand why the pattern does not match:
p1 = re.compile('''(\d{2} # Matches two digits -- e.g: 13
\s* # Matches any number of spaces
- # Matches the literal character -
\s* # Matches any number of spaces
\d{2} # Matches two digits -- e.g: 06
\s* # Matches any number of spaces
- # Matches the literal character -
\s* # Matches any number of spaces
\d{4}) # Matches four digits -- e.g: 2017''', re.VERBOSE)
txt3 = 'date 13 – 06 - 2017. '
p1.findall(txt3)
[]
Can you explain the failure? How the code should be corrected?