Hello,
The following code in Python returns what I expect:
m = re.match(r'(?:(A+)|(B+))+','AB')
print (m.group(),m.group(1),m.group(2)) -> ('AB', 'A', 'B')
But in Javascript, I'v got a non expected 'undefined'
var m = /(?:(A+)|(B+))+/.exec('AB');
alert (m[0] + ',' + m[1] + ',' + m[2]); -> AB,undefined,B
Could you explain the js behavior and how to fix it to have Python like result.
Thank you