Replace a hard-to-read regex in your codebase with a readable super-expressive method chain that your teammates can understand.
Define a reusable sub-pattern for email or URL validation and compose it into multiple larger form validators.
Port a JavaScript regex to PHP or Python using one of the community-contributed super-expressive language ports.
Super Expressive is a JavaScript library that lets you build regular expressions by chaining plain-English method names instead of writing the terse symbol-heavy syntax that regular expressions normally require. Regular expressions are patterns used in code to find, match, or validate text, but their compact notation is notoriously hard to read and remember. This library offers an alternative way to write them that is easier to understand and review. Instead of writing something like /^(?:0x)?([A-Fa-f0-9]{4})$/, you chain methods like .startOfInput, .optional.string('0x'), .exactly(4).anyOf, and .endOfInput to describe the same pattern step by step. The resulting object can be converted to a standard JavaScript regex at the end, so it works with everything that already uses regular expressions. The library has no dependencies and weighs less than 4kb. The API is designed to be discoverable: method names describe what they do in plain terms, order follows how you would read the rule in English, and the library gives helpful error messages if you chain something incorrectly. You can also define reusable sub-patterns and compose them into larger expressions, which is useful when the same matching rule appears in multiple places. The library includes full TypeScript support and has been ported to PHP, Ruby, and Python by community contributors. A browser-based playground is available for testing patterns interactively without writing any code. The README covers the full API with short code examples for every method, including flags like case-insensitive matching, multiline mode, and Unicode support.
← francisrstokes on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.