Reputation: 126
I am trying to match a set of complex numbers with re.match(). I am pretty sure the regex should work but still Python doesn't return anything.
pattern = '\.\d+\.\d+\w\.'
value = str(complex(17, 80))
string = '' + value
print(re.match(pattern, string).group())
The output should be something like:
(17+80j)
But instead it is:
AttributeError: 'NoneType' object has no attribute 'group'
Upvotes: 0
Views: 875