Javascript global modifier question
Posted: Sun Jan 22, 2006 6:25 am
Hi,
Seems that I've misunderstood the behaviour of the global modifier, g, in Javascript RegExp...
The following js
should match both A=1 and B=2, but only A=1 is matched. What am I missing?
tores
Seems that I've misunderstood the behaviour of the global modifier, g, in Javascript RegExp...
The following js
Code: Select all
var string = 'A=1, B=2, C=3';
var match = (/(a¦b)=\d+/gi).exec(string);
document.write(match);
document.close();tores