neonious / lowjs

A port of Node.JS with far lower system requirements. Community version for POSIX systems such as Linux, uClinux or Mac OS X.

Home Page:http://www.lowjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/\033/ → SyntaxError: invalid regexp escape

jirutka opened this issue · comments

/\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.

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..?