{"library":"regexpu","title":"regexpu","description":"regexpu is a source code transpiler that enables the use of ES2015 Unicode regular expressions (the `u` flag) in ES5 environments. It rewrites regex literals with the `u` flag into equivalent ES5-compatible patterns, handling Unicode properties, escapes, and case folding. Current version 4.8.0 (stable) releases infrequently; major version bumps (e.g., 2.0.0) introduced breaking changes in module export paths. Key differentiators: it is the core engine behind Babel, Traceur, and other transpilers for Unicode regex; also ships `regexpu-core` for programmatic use. Supports Node >=6 and browsers via bundlers.","language":"javascript","status":"active","last_verified":"Fri May 01","install":{"commands":["npm install regexpu"],"cli":null},"imports":["import { rewritePattern } from 'regexpu'","import regexpu from 'regexpu'","import { rewritePattern } from 'regexpu-core'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { rewritePattern } from 'regexpu-core';\n\n// Transpile a regex with the u flag to ES5\nconst pattern = '\\\\p{ASCII_Hex_Digit}';\nconst flags = 'u';\nconst result = rewritePattern(pattern, flags);\nconsole.log(result); // '[A-Fa-f0-9]'\n\n// With support for Unicode properties\nconst pattern2 = '\\\\p{Emoji}';\nconst flags2 = 'u';\nconst result2 = rewritePattern(pattern2, flags2, { unicodePropertyEscape: true });\nconsole.log(result2); // '[...]'","lang":"typescript","description":"Transpiles a Unicode regex pattern with the u flag to an ES5-compatible equivalent, demonstrating usage of rewritePattern with options.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}