mathiasbynens/regexpu
A source code transpiler that enables the use of ES2015 Unicode regular expressions in ES5.
Converts ES2015 Unicode regex patterns with the `u` flag into ES5-compatible surrogate pair sequences, handling astral plane characters like emoji through systematic transpilation of regex literals. Integrates directly with major transpilers—Babel, Traceur, Bublé, and esnext—and relies on regjsparser for AST parsing and regenerate for Unicode range generation. Supports both CLI and programmatic API usage, though it doesn't handle dynamic RegExp constructors or complex edge cases like lone surrogates.
240 stars and 948,616 monthly downloads. No commits in the last 6 months. Available on npm.
Stars
240
Forks
19
Language
JavaScript
License
MIT
Category
Last pushed
Sep 18, 2024
Monthly downloads
948,616
Commits (30d)
0
Dependencies
3
Get this data via API
curl "https://pt-edge.onrender.com/api/v1/quality/ai-coding/mathiasbynens/regexpu"
Open to everyone — 100 requests/day, no key needed. Get a free key for 1,000/day.
Related tools
chrishoermann/zod-prisma-types
Generator creates zod types for your prisma models with advanced validation
unjs/knitwork
🧶 Utilities to generate safe JavaScript code.
microsoft/ts-gyb
Generating native code interfaces from TypeScript
retejs/rete-studio
A general-purpose code generation tool powered by Rete.js
mathiasbynens/regenerate
Generate JavaScript-compatible regular expressions based on a given set of Unicode symbols or...