Before this fix, the regex engine would run into an infinite loop and OOM when encountering a quantifier allowing a zero amount of items in a REG_GLOB regex.
This fixes a freeze/crash in the Final Fantasy XIV Launcher during the registration process.
-- v2: jscript/tests: Add tests for star and opt operators in global regex. jscript: Handle star and opt operators while matching global regex properly.