Can someone please explain why my compile doesn't match this string. I just get an empty list.
I tried using VERBOSE mode as well.
The first part (+45) is supposed to be optional (therefore the ?)
Then the next line can either be a dash or a space (i tried making a regular space, and that didnt work either. this is optional as well
Then the four digits
then another separator, also optional
Then the last 4 digits.
import re
b = re.compile(r"(\+45)?(-|\s)?\d\d\d\d(-|\s)?\d\d\d\d")
b.findall("+45 2222 2222 is")