Here is the case: I want to find the elements which match the regex...
targetText = \"SomeT1extSomeT2extSomeT3extSomeT4extSomeT5extSomeT6ext\"
targetText = "SomeT1extSomeT2extSomeT3extSomeT4extSomeT5extSomeT6ext" reg = new RegExp(/e(.*?)e/g); var result; while (result = reg.exec(targetText)) { ... }