You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [compat-transpiler](https://github.com/DmitrySoshnikov/regexp-tree/tree/master/src/compat-transpiler) module is also available as a _Babel plugin_, which can be installed at: [babel-plugin-transform-modern-regexp](https://www.npmjs.com/package/babel-plugin-transform-modern-regexp).
395
+
396
+
Note, the plugin also includes [extended regexp](#regexp-extensions) features.
397
+
390
398
### Creating RegExp objects
391
399
392
400
To create an actual `RegExp` JavaScript object, we can use `regexpTree.toRegExp` method:
@@ -444,6 +452,12 @@ This is normally parsed by the _regexp-tree_ parser, and [compat-transpiler](#us
444
452
/(\d{4})-(\d{2})-(\d{2})/
445
453
```
446
454
455
+
#### RegExp extensions Babel plugin
456
+
457
+
The regexp extensions are also available as a _Babel plugin_, which can be installed at: [babel-plugin-transform-modern-regexp](https://www.npmjs.com/package/babel-plugin-transform-modern-regexp).
458
+
459
+
Note, the plugin also includes [compat-transpiler](#using-compat-transpiler-api) features.
460
+
447
461
### AST nodes specification
448
462
449
463
Below are the AST node types for different regular expressions patterns:
Copy file name to clipboardExpand all lines: src/compat-transpiler/README.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,4 +42,10 @@ If whitelist is not passed, all transforms are applied.
42
42
Available transforms are:
43
43
44
44
*`dotAll` - translates `/./s` into `/[\0-\uFFFF]/`
45
-
*`namedCapturingGroups` - transforms `/(?<name>a)\k<name>/` into `/(a)\1/`
45
+
*`namedCapturingGroups` - transforms `/(?<name>a)\k<name>/` into `/(a)\1/`
46
+
47
+
## Babel plugin
48
+
49
+
The _compat-transpiler_ module is also available as a _Babel plugin_, which can be installed at: [babel-plugin-transform-modern-regexp](https://www.npmjs.com/package/babel-plugin-transform-modern-regexp).
50
+
51
+
Note, the plugin also includes [extended regexp](https://github.com/dmitrysoshnikov/regexp-tree#regexp-extensions) features.
0 commit comments