esmangle icon indicating copy to clipboard operation
esmangle copied to clipboard

reduce escape sequences in regular expressions

Open michaelficarra opened this issue 12 years ago • 1 comments

We already do something similar with strings, reducing '\x20' to ' ' (escodegen handles this for us automatically). It gets trickier with regular expressions, though, because we will need to avoid control characters such as [](){}-\. When expressed as \u????, these control characters can still be reduced to \x??.

michaelficarra avatar Sep 26 '13 13:09 michaelficarra

It breaks the regexp.source result. So we need to provide advance mode to do such optimizations.

Constellation avatar Sep 28 '13 17:09 Constellation