Get the question when looking up for templates engine realization.
And this article mainly focus
(?!) Negative lookahead condition.
- And the explanation
Function: Match A whose word behide it is
Mainly talking about
test function will save the pattern match
session, so the 2nd withG search will return
and global will return back to index 0 to repeat check the str, 3rd is
true, of course;
in 2nd loop, withG’s output is not like the withG2 though they are same RegExp, because of the tmpStr
resetwithG’s match string, so withG’s result always get
trueeven it has global flag.
PS: Same as RegExp.