regex-fun: Functional Regular Expression Builder

JSON →
library 3.1.0 ·javascript
verified May 27, 2026

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.

total hits 31
actors 7 distinct systems
last hit 20h ago human
GPTBot
5
MetaBot
4
Script
1
ClaudeBot
1
Search engines
2
Humans
1

top countries 🇨🇦 Canada · 🇺🇸 United States · 🇫🇷 France · 🇩🇪 Germany