firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.29k stars 199 forks source link

allow / not need to escape when Switch to ECMAScript #1359

Closed dnknn closed 3 years ago

dnknn commented 4 years ago

sorry for my English, translate by Google most 🤦🙈

related https://github.com/firasdib/Regex101/issues/1355

A case could be made for supporting both the literal as well as the string notation for the ECMAScript flavour.

It will be convenient for ordinary users are not developers.

0715153338


https://github.com/firasdib/Regex101/issues/1358


   E.g 🐵Tampermonkey 🆂 Stylus Stylish 🔍Regular search in text editor .etc... There are many Chrome extensions with RegExp functions, I personally have not seen one that needs to be escaped /

Other regular test sites are also allowed to escape, e.g. debuggex or jex.im/regulex (I don’t know, maybe they are not in ECMAScript mode,)

As long as it is not a place to write code, almost no escaping is allowed, especially where it is related to the URLs RegExp.

As / is not used as delimiter tcharacter, you do not need to escape it like in other RegExp environments.



firasdib commented 3 years ago

If you use the RegExp constructor you do not need to escape the slash, you are right, but 99% of developers do not use that, and thus need to escape the slash. Thus I've decided to mimic that behavior.