Last active
June 13, 2020 09:14
-
-
Save nitayneeman/7fa63c4f009366027a33b59b0393d50c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regex = /t(e)(st(\d?))/g; | |
let matchingValue; | |
while ((matchingValue = regex.exec('test1test2')) !== null) { | |
console.log(matchingValue); | |
} | |
// Output: | |
// ["test1", "e", "st1", "1", index: 0, input: "test1test2", groups: undefined] | |
// ["test2", "e", "st2", "2", index: 5, input: "test1test2", groups: undefined] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment