micromatch/to-regex-range
Pass two numbers, get a regex-compatible source string for matching ranges. Fast compiler, optimized regex, and validated against more than 2.78 million test assertions. Useful for creating regular expressions to validate numbers, ranges, years, etc.
4 best points · 0 comments · 2 Hacker News posts · 173 GitHub stars · View on GitHub
Hacker News discussions
- Removing one NPM dependency saved 440GB weekly traffic (4 points, 0 comments, by eykrehbein, 2024-07-30)
- Fix: Replace is-number dep with a one-liner (4 points, 0 comments, by SushiHippie, 2024-08-02)