Babel has inefficient RexExp complexity in generated code with .replace when transpiling named capturing groups
When using Babel to compile regular expression named capturing groups, Babel will generate a polyfill for the .replace method that has quadratic complexity on some specific replacement pattern strings (i.e. the second argument passed to .replace). Your generated code is vulnerable if all the following conditions are true: You use Babel to compile regular expression named capturing groups You use the .replace method on a regular expression that contains named …