magic-regexp is a type-safe regular expression builder and TypeScript compiler. It allows for the construction of JavaScript regular expressions using a readable syntax that automatically generates precise types for captured groups, ensuring predictable data extraction.
The project functions as a build-time transformer that converts custom pattern syntax into standard regular expression objects. This static compilation removes runtime overhead by shifting the transformation logic to the build process.
The tool covers named capture group generation and a readable construction API that replaces raw regex strings. It includes capabilities for referencing captured groups, predicting match results at the type level, and converting standard regular expressions back into the readable syntax.