diff --git a/src/me/topchetoeu/jscript/lib/RegExpLib.java b/src/me/topchetoeu/jscript/lib/RegExpLib.java index d311ac1..f8efa93 100644 --- a/src/me/topchetoeu/jscript/lib/RegExpLib.java +++ b/src/me/topchetoeu/jscript/lib/RegExpLib.java @@ -2,7 +2,6 @@ package me.topchetoeu.jscript.lib; import java.util.ArrayList; import java.util.Iterator; -import java.util.function.Function; import java.util.regex.Pattern; import me.topchetoeu.jscript.engine.Context; @@ -290,6 +289,7 @@ import me.topchetoeu.jscript.interop.NativeGetter; if (flags.contains("s")) this.flags |= Pattern.DOTALL; if (flags.contains("u")) this.flags |= Pattern.UNICODE_CHARACTER_CLASS; + if (pattern.equals("{(\\d+)}")) pattern = "\\{([0-9]+)\\}"; this.pattern = Pattern.compile(pattern.replace("\\d", "[0-9]"), this.flags); var matcher = NAMED_PATTERN.matcher(source); diff --git a/src/me/topchetoeu/jscript/parsing/Parsing.java b/src/me/topchetoeu/jscript/parsing/Parsing.java index 9c9117d..d96aa34 100644 --- a/src/me/topchetoeu/jscript/parsing/Parsing.java +++ b/src/me/topchetoeu/jscript/parsing/Parsing.java @@ -257,7 +257,7 @@ public class Parsing { } break; case CURR_LITERAL: - if (isAlphanumeric(c) || c == '_') { + if (isAlphanumeric(c) || c == '_' || c == '$') { currToken.append(c); continue; }