regex-fun: Functional Regular Expression Builder
JSON →regex-fun is a utility library for JavaScript and TypeScript that facilitates the programmatic construction of regular expressions using a functional, composable API. It provides a comprehensive set of functions like `combine`, `either`, `capture`, and various quantifiers (e.g., `optional`, `anyNumber`, `oneOrMore`, `exactly`, `atLeast`, `between`, and their non-greedy counterparts) to build complex regex patterns from smaller, readable components. A key differentiator is its automatic escaping of string inputs, which prevents common regex syntax errors when embedding literal strings, treating them as fixed text rather than regex patterns. The library ships with TypeScript types, ensuring strong type-checking and autocompletion for users in modern development environments. The current stable version is 3.1.0, and new functions are added on an ad-hoc basis driven by maintainer needs, rather than a strict release cadence.
Traffic · last 30 days ↓65% vs prev 7d
top countries 🇨🇦 Canada · 🇺🇸 United States · 🇫🇷 France · 🇩🇪 Germany