awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
unjs avatar

unjs/magic-regexp

0
View on GitHub↗
4,331 stars·71 forks·TypeScript·MIT·22 viewsregexp.dev↗

Magic Regexp

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.

Features

  • Type-Safe Regular Expressions - Compiles readable chainable regex syntax into native RegExp objects with automatic TypeScript type inference for capture groups.
  • Readable Regex Builders - Builds regular expressions by chaining readable method calls instead of writing raw pattern strings.
  • Readability Tooling - Builds regular expressions using chainable natural-language methods instead of raw pattern strings for improved readability.
  • Regular Expression Builders - Builds regular expressions using chainable methods like exactly and oneOrMore instead of raw pattern strings.
  • Readable Regex Constructors - Constructs regular expressions by chaining natural-language helpers like exactly, maybe, and oneOrMore instead of writing raw patterns.
  • Type-Safe Capture Generators - Automatically derives TypeScript types from named capture groups for compile-time validation of matched data.
  • Compile-Time Regex Compilation - Transforms readable regex syntax into native RegExp objects during compilation to eliminate runtime overhead.
  • Named Capture Group Generators - Automatically derives TypeScript types from named capture groups in regex patterns for compile-time validation.
  • Named Capture Groups - Wraps part of a pattern in a named capture group so the matched value is accessible by name in the result object.
  • Regex Builder Chains - Builds regular expressions by chaining natural-language methods like exactly and oneOrMore instead of raw strings.
  • String Literal Match Type Predictions - Derives exact TypeScript types from string literal inputs for compile-time validation of regex matches.
  • Lookahead and Lookbehind Helpers - Provides chainable methods for adding lookahead and lookbehind conditions to regex patterns.
  • Regex Lookaround Assertions - Adds positive or negative lookahead and lookbehind conditions to a pattern using helpers like after, before, and notBefore.
  • Regular Expression Converters - Converts existing regular expressions into readable builder syntax for easier maintenance and understanding.
  • Regex Lookahead Helpers - Ships chainable methods like after and before for adding lookahead and lookbehind assertions to patterns.
  • Regex Syntax Converters - Provides a bidirectional converter that translates existing RegExp literals into readable builder syntax.
  • Regex Syntax Tree Compilers - Parses the builder chain into an abstract syntax tree and compiles it to a standard RegExp literal at build time.
  • Bidirectional Regex Syntax Converters - Translates existing RegExp literals into readable builder syntax and back for easier maintenance.

Star history

Star history chart for unjs/magic-regexpStar history chart for unjs/magic-regexp

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Projects sharing features with Magic Regexp

These projects share indexed features with Magic Regexp. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • francisrstokes/super-expressivefrancisrstokes avatar

    francisrstokes/super-expressive

    4,615View on GitHub↗

    Super-expressive is a zero-dependency JavaScript library and domain-specific language used to construct complex regular expressions. It functions as a pattern generator that uses natural language syntax to produce native regular expression objects or strings, supporting international text standards through Unicode property matching. The library replaces manual string manipulation and escaping with a method-chaining fluent interface. It allows for modular expression composition, enabling the creation of reusable pattern hierarchies where existing expression instances can be nested as subexpres

    JavaScript
    View on GitHub↗4,615
  • yoav-lavi/melodyyoav-lavi avatar

    yoav-lavi/melody

    4,747View on GitHub↗

    Melody is a regular expression transpiler and pattern compiler that translates a high-level, human-readable syntax into standard regular expressions. It functions as a tool to simplify the creation and maintainability of complex matching patterns. The project provides a specialized syntax for defining reusable variables and macros to reduce duplication within expressions. It includes native support for mapping specialized labels to Unicode category properties and automatically handles the escaping of literal text. The system is accessible through several interfaces, including a command-line

    Rust
    View on GitHub↗4,747
  • verbalexpressions/jsverbalexpressionsVerbalExpressions avatar

    VerbalExpressions/JSVerbalExpressions

    12,149View on GitHub↗

    JSVerbalExpressions is a JavaScript regex builder and construction library that provides a domain-specific language for assembling complex regular expressions. It replaces the use of dense string literals with a programmatic interface and readable method chains. The library allows for the creation of search patterns and validation rules through a fluent API. This approach enables the development of regular expressions that are maintainable and easy for other developers to understand.

    JavaScriptjavascript-regular-expressionsverbalexpressions
    View on GitHub↗12,149
  • arktypeio/arktypearktypeio avatar

    arktypeio/arktype

    7,780View on GitHub↗

    Arktype is a TypeScript runtime validation library and schema orchestrator. It synchronizes TypeScript types with runtime data validation, allowing users to define type-safe schemas that ensure unknown data adheres to specific structures during application execution. The project distinguishes itself by using set-theory type analysis to determine intersections and subtype compatibility, alongside JIT-compiled validation functions for optimized performance. It supports advanced type modeling through branded type constraints, recursive alias resolution, and the ability to generate runtime valida

    TypeScriptjavascriptparsingruntime-typechecking
    View on GitHub↗7,780
Compare all 7 related projects→

Frequently asked questions

What does unjs/magic-regexp do?

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.

What are the main features of unjs/magic-regexp?

The main features of unjs/magic-regexp are: Type-Safe Regular Expressions, Readable Regex Builders, Readability Tooling, Regular Expression Builders, Readable Regex Constructors, Type-Safe Capture Generators, Compile-Time Regex Compilation, Named Capture Group Generators.

Which projects share features with unjs/magic-regexp?

Projects with overlapping indexed features include: francisrstokes/super-expressive — Super-expressive is a zero-dependency JavaScript library and domain-specific language used to construct complex… yoav-lavi/melody — Melody is a regular expression transpiler and pattern compiler that translates a high-level, human-readable syntax… verbalexpressions/jsverbalexpressions — JSVerbalExpressions is a JavaScript regex builder and construction library that provides a domain-specific language… arktypeio/arktype — Arktype is a TypeScript runtime validation library and schema orchestrator. It synchronizes TypeScript types with… oils-for-unix/oils — Oils is a Unix shell interpreter and scripting language runtime that combines a modern shell language with POSIX and… rust-lang/rfcs — The Rust RFCs repository is the formal home for the Rust language evolution process, housing the structured design…