📅  最后修改于: 2022-03-11 15:02:50.678000             🧑  作者: Mango
/*
The main difference between string.match and regex.exec is,
the regex object will be updated of the current match with
regex.exec call.
For example,
*/
var myString = "[22].[44].[33].", myRegexp = /\d+/g, result;
while (result = myRegexp.exec(myString)) {
console.log(result, myRegexp.lastIndex);
}