I want to find telephone numbers in string. I use the following code
import re
a = '88005553535'
test = re.compile('(\+?[0-9]{1}( |-)?([0-9]{3}|\\([0-9]{3}\\))( |-)?[0-9]{3}( |-)?[0-9]{2}( |-)?[0-9]{2})+')
print(test.findall(a))
but I have [('88005553535', '', '800', '', '', '')]
in result. I realize it happens due to existence of several groups in regex, but I don't understand clearly why do they appear. How should I avoid it?