Created
April 17, 2017 19:57
-
-
Save DmitrySoshnikov/5cc481a1bde3a1e54e74201ce4395aac to your computer and use it in GitHub Desktop.
regexp-tree-compat-transpiler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regexpTree = require('regexp-tree'); | |
// Using new syntax. | |
const originalRe = '/(?<all>.)\\k<all>/s'; | |
// For legacy engines. | |
const compatTranspiledRe = regexpTree | |
.compatTranspile(originalRe) | |
.toRegExp(); | |
console.log(compatTranspiledRe); // /([\0-\uFFFF])\1/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment