fixed RegexNode issue with global flag

the second regex test fails due regex bug. Needed to reset lastIndex of the regex Object.