21 May 14:42
"repeating pair" regex
Thor <Thor <at> hotmail.com>
2012-05-21 12:42:24 GMT
2012-05-21 12:42:24 GMT
Hi,
I tried something like this...
auto m = match("a=42 b=32 c=22", regex(`^(?: \s* (\w+)=(\d+)
)+$`, `x`));
This works fine...
`^(?: \s* (\w+)=(\d+) )+$`
... and if I duplicate the string x times, it also works...
But I'm hoping to parse a variable number of these 'pairs'... so
I tried grouping the pairs in (?:)+ but this way it saves only
the last pair?
Anyone got an idea?
RSS Feed