Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reset regex javascript

// A JavaScript RegExp object is stateful.
// When the regex is global, if you call a method on the same regex object, it will start from the index past the end of the last match.
// When no more matches are found, the index is reset to 0 automatically.

reg.lastIndex = 0;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #reset #regex #javascript
ADD COMMENT
Topic
Name
3+7 =