regular expression lazy pattern means that if the expression matches successfully, it will match as few characters as possible.
according to the literal meaning, take a look at my code as follows
var pattern=/a(\w*?)/;
var str="a123a";
console.log(str.replace(pattern,"$1"));
I expect the output is" 1century, because of the lazy mode, matching a character can make it a success
, but the actual output is" 123a", which is the same as the greedy mode output
Why is this?