"repeating pair" regex

Thor Thor at hotmail.com
Mon May 21 05:42:24 PDT 2012


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?



More information about the Digitalmars-d-learn mailing list