jscript: Correctly handle -1 index in regexp match result.