0

I'm trying to get only all full matches in a string, but it needs multiple groups.

import re 

coordParse = re.compile(r'[a-zA-Z]\s*\(\d+(\.\d+)?,(\s)*\d+(\.\d+)?\)')
n = 'a(3.43, 5834) b (84, 45.89) C(48, 36.)'

print(coordParse.findall(n))

findall returns:

[('.43', ' ', ''), ('', ' ', '.89')]

what I want is:

['a(3.43, 5834)', b (84, 45.89)]

Group only returns the first match. Is there some way to return only all full matches?

0 Answers0