This library generates a regex-compatible string for matching a numeric range, based on two input numbers (min and max). It’s useful when you need to build validation regular expressions for numbers, ranges, years, or similar values, and it includes options for capture wrapping, shorthand digit matching, and relaxing or enforcing zero padding.
Project status
- Maintenance status: The repo shows the last upstream push on 2024-08-01, but the most recent packaged version update in the provided history is 5.0.1 (2019-04-07), suggesting the source is largely quiet, not actively maintained, as of 2026-06-09.
- Apparent cadence: Historically, updates came in bursts (2016 to 2019), but there are no provided version updates since 2019, indicating a long gap compared to typical active libraries.
AI summary generated
Recent updates
5.0.1
Release 5.0.1 contains substantial internal refactoring of the regex range generation logic, with changes that affect the exact generated regex source string. No publisher release notes were provided for this version, so behavioral changes must be inferred from the code diff.
4.0.2
Release 4.0.2 contains no provided release notes. The code diff is small but changes internal iteration logic in index.js (zip) and updates README documentation including regenerated example outputs and test timing.
4.0.1
Release 4.0.1 was published on 2018-07-04, but no release notes were provided by the publisher. No documented changes, feature additions, fixes, or breaking behavior details are available from the release notes.
4.0.0
Release 4.0.0 appears to be a modernization/refactor of the to-regex-range implementation (syntax updates, internal caching refactor) plus dependency and Node.js support updates. There are no release notes provided by the publisher, so compatibility-impacting changes must be inferred from the code and package metadata diff.
3.0.0
Release 3.0.0 contains no provided release notes. The diff indicates mostly metadata, tooling, and documentation updates, plus a major runtime dependency bump (is-number) and a change to the exports of a local examples helper.
2.1.1
No release notes were provided for version 2.1.1. The code diff indicates this release is primarily documentation and package metadata updates, with no visible changes to the core range-to-regex logic.
2.1.0
Release 2.1.0 has no publisher-provided release notes. The code changes in this release primarily add or alter regex generation behavior via new/expanded options (capture, shorthand, relaxZeros) and adjust the string form of generated digit ranges (for example, rendering adjacent ranges as [01] instead of [0-1]).
BreakingFeatures2.0.0
Release 2.0.0 introduces significant new behavior in the main export to-regex-range, including support for zero-padded numeric strings and an optional capture mode. The published release notes for 2.0.0 were not provided, so developers should verify behavior against real outputs, especially if they depend on the exact generated regex source string.
BreakingFeatures1.0.2
Release 1.0.2 contains no published release notes. The diff shows only metadata and documentation-level changes, with no application logic or API surface modifications.
1.0.1
Release 1.0.1 was published on 2016-10-19, but no release notes were provided by the publisher. As a result, there is no stated information about new features, bug fixes, breaking changes, or security updates in this release.
0.1.2
Release 0.1.2 has no provided release notes, but the code diff shows a small refactor and performance-oriented changes primarily inside index.js, plus dependency updates. The externally documented API appears unchanged (toRegexRange(min, max)), but internal behavior of regex construction was modified.
Breaking0.1.1
Release 0.1.1 was published on 2015-08-07. No release notes were provided by the publisher, so this release cannot be reliably assessed for developer-impacting changes.