13 Dec
2001
13 Dec
'01
12:05 p.m.
I'm trying to match strings of the form "a&b&c&d" with the following expression: "(?:([^&]+)&)*([^&]+)". This nicely matches the whole string but instead of giving me the submatches "a", "b", "c" and "d" I just get "c" and "d". Could anyone tell me what I'm doing wrong?
Look more closely at your expression: it has only *two* marked sub-expressions, $1 gets "overwritten" each time it matches. - John Maddock http://ourworld.compuserve.com/homepages/john_maddock/