tc39 / proposal-regex-escaping

Proposal for investigating RegExp escaping for the ECMAScript standard
http://tc39.es/proposal-regex-escaping/
Creative Commons Zero v1.0 Universal
363 stars 32 forks source link

Need better example #44

Open hax opened 3 years ago

hax commented 3 years ago

Current example in README is:

text.replace(new RegExp(RegExp.escape(str), "g"), newSubstr)

But because we now have replaceAll, it could be simply ourLongText.replaceAll(str, newSubstr) now.

benjamingr commented 3 years ago

PR welcome