I'm trying to match (if possible, only) the values of coordinates contained in lines like:
function f is described by the (x,y) couples: 0.000000E+00 0.000000E+00 5.00000 0.500000E-01 1.0000 0.290000 2.0000 1.56000 3.0000 5.47000 4.0000 17.3000 4.50000 31.2000 5.0000 52.6000
The first couple is matched as wished, that is to say in two different groups, by
(?<=\bcouples:\s)(\S+)\s+(\S+)\s+
Then,
(?<=\bcouples:\s)((\S+)\s+(\S+)\s+)+
matches the whole line, but only splits the last two coordinates in separate groups.
Precision: the number of couples of coordinates is not known, so just adding several times
(\S+)\s+(\S+)\s+
in the end of the regex is not an option.
Thanks for your input!