Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/\033/ → SyntaxError: invalid regexp escape #79

Open
jirutka opened this issue Oct 25, 2019 · 1 comment
Open

/\033/ → SyntaxError: invalid regexp escape #79

jirutka opened this issue Oct 25, 2019 · 1 comment

Comments

@jirutka
Copy link
Contributor

jirutka commented Oct 25, 2019

/\033/.test("\033")
SyntaxError: invalid regexp escape (line 1)
    [...]

\033 is a valid escape character; it’s an octal representation of the ESC character from ASCII, 1B in hex. And it works in Node.js, browsers and even other langs (e.g. Ruby).

Equivalent to \033 is /\x1B/ that works in lowjs.

@ThomasRogg
Copy link
Member

See DukTape issue:

As far as I recall these are part of the Annex B optional regexp syntax features https://www.ecma-international.org/ecma-262/6.0/#sec-regular-expressions-patterns. Duktape only supports some parts of the Annex B syntax at present.

I think that is OK, have not noticed any lib/module actually using the other syntax..?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants