When ran multiple times (e.g. placed in a function) for the same regex string, the generated code doesn't find a match, because the regex.lastIndex is not reset. The generated code should take care of this, e.g. after the "const regex = ..." line, the second line should be regex.lastIndex = 0;
Reproduction steps
run the generated code multiple times
Expected Outcome
for the same regex and str arguments, the code should generate the same results when ran multiple times
Bug Description
When ran multiple times (e.g. placed in a function) for the same regex string, the generated code doesn't find a match, because the regex.lastIndex is not reset. The generated code should take care of this, e.g. after the "const regex = ..." line, the second line should be regex.lastIndex = 0;
Reproduction steps
run the generated code multiple times
Expected Outcome
for the same regex and str arguments, the code should generate the same results when ran multiple times
Browser
N/A
OS
N/A