swc-project / swc

Rust-based platform for the Web
https://swc.rs
Apache License 2.0
30.9k stars 1.2k forks source link

Transpile regexp unicode property escapes #1649

Open mischnic opened 3 years ago

mischnic commented 3 years ago

Describe the feature

Transpile regexp unicode property escapes

const IDENTIFIER_RE = /\p{ID_Start}/u;
console.log(IDENTIFIER_RE)

Example

Babel plugin or link to the feature description

https://babeljs.io/docs/en/babel-plugin-proposal-unicode-property-regex

https://github.com/tc39/proposal-regexp-unicode-property-escapes

Babel REPL

https://mothereff.in/regexpu

mischnic commented 3 years ago

https://babeljs.io/docs/en/babel-plugin-transform-unicode-regex is probably also related

shirazz commented 2 years ago

👍

chentsulin commented 2 years ago

Regex transforms (unicode, dotall, named-capturing-groups) probably should be implemented together. They are implemented using a shared createRegExpFeaturePlugin helper in babel:

sigorilla commented 3 months ago

Up