Ship a function to quote regular expressions. #37488
Replies: 6 comments
-
Bikeshedding: |
Beta Was this translation helpful? Give feedback.
-
Your TC39 proposal seems very reasonable to me! 👍 |
Beta Was this translation helpful? Give feedback.
-
TC39 has agreed to promote the proposal to stage 1 - so I'd really rather pursue it there first. |
Beta Was this translation helpful? Give feedback.
-
@benjamingr ... any objections to converting this into a discussion rather than keeping it open as an issue? |
Beta Was this translation helpful? Give feedback.
-
@jasnell sure |
Beta Was this translation helpful? Give feedback.
-
Proposal TC39 RegExp Escaping Proposal FYI:
|
Beta Was this translation helpful? Give feedback.
-
Hey,
One of the most "obvious" missing features in Node.js regular expressions that every other platform ships is the ability to "escape" them. That is:
There are multiple packages doing this subtly incorrectly on NPM -
lodash
,escape-regexp
and a few others.I've worked on a TC39 proposal to add this API to the language and it is being considered again - but if the language committee rejects the proposal - the next best place is the platform.
My current plan is:
In regards to other languages and platforms - it seems that some ship this sort of API as part of the language and some do so as part of the platform.
I am opening this issue here for discussion of the plan.
An alternative suggested by some whatwg members is trying to coordinate this sort of API with them.
Beta Was this translation helpful? Give feedback.
All reactions