Skip to content

Instantly share code, notes, and snippets.

@ashwinkumar2438
Created August 31, 2020 18:18
Show Gist options
  • Save ashwinkumar2438/72f36d7a8e99f27e873b7f485ae8ce5e to your computer and use it in GitHub Desktop.
Save ashwinkumar2438/72f36d7a8e99f27e873b7f485ae8ce5e to your computer and use it in GitHub Desktop.
var regex=/\d/y;
regex.lastIndex=3;
regex.exec("0123")[0]; // returns '3' instead of '0' as the regex starts the search from the index 3 of string.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment