NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2746 most downloaded on npm
Regex template tag with extended syntax, context-aware interpolation, and always-on best practices
Last release 9 months ago
09 Dec 2025
Ships unpredictably
gaps range from 8 days to 10 months
Nearly every release is documented
notes for 27 of 27 stable releases
2 versions withdrawn
withdrawn after publishing
13 years old
29 releases · first in 2013
Added support for interpolating a standalone subroutine definition group via pattern .
pattern. (#34)(?:…) wrapper in more cases when it's not needed../internals : Update plugin argument types.
./internals: Update plugin argument types.One column per quarter.
This version's breaking changes don't affect direct use of the library, so they won't affect most users. The modified APIs are used by tools that buil…
This version's breaking changes don't affect direct use of the library, so they won't affect most users. The modified APIs are used by tools that build on top of Regex+.
pattern../internals: Removed RegExpSubclass's undocumented support for capture transfer../internals: Removed emulationGroupMarker; markers are no longer used for hidden captures.rewrite: Renamed the returned expression property as pattern.subclass option, especially with long patterns that contain extended syntax.Edge case fix for emulation-only capturing groups with transfer markers (for libraries that use Regex+ internals).
Export emulationGroupMarker in ./internals .
emulationGroupMarker in ./internals.RegExpSubclass.
Enables better tree shaking for ./internals .
./internals.Minor improvements for subclass types and error handling.
Version 5 is a minor update with small breaking changes that won't affect most people.
This library was renamed from just regex to Regex+, to make it easier to refer to the library and its regex flavor. The package and tag name remain regex as before, so this has no effect on code.
Version 5 is a minor update with small breaking changes that won't affect most people.
d.ts) were moved from ./types to ./dist/esm and ./dist/cjs../atomic export added in v4.4.0 was renamed as ./internals.RegExpSubclass was made available via ./internals.subclass and flag d, resulting subpattern indices are adjusted to account for emulation groups.Added ./atomic to exports, allowing direct use of the atomic and possessive plugins in other libraries.
./atomic to exports, allowing direct use of the atomic and possessive plugins in other libraries.When an invalid regex throws, always include the generated source and flags in the error message (some browsers automatically include them, but Firefo
\u{…} to hexadecimal. In other words, although interpolating a string like regex`\u{${'160'}}` returns /\u{160}/, interpolating the number regex`\u{${160}}` in this context returns /\u{A0}/. (#24, @graphemecluster)Fix for character classes that contain + after certain other punctuation.
+ after certain other punctuation.Fix usage of multiple possessive quantifiers in the same regex.
Removed the rewrite function's deprecated alias processRegex.
\u{0} with \x00 in emitted source for sandboxed null tokens.rewrite function's deprecated alias processRegex.
rewrite is no longer considered experimental.processRegex remains as a deprecated alias but will be removed in the next release.
processRegex as rewrite.
processRegex remains as a deprecated alias but will be removed in the next release.Added function processRegex, which returns an object with expression and flags strings.
processRegex, which returns an object with expression and flags strings.
unicodeSetsPlugin is explicitly set to null, allow whitespace-separated, unescaped (literal) hyphens on the end of character class ranges.Added a top-level types field to package.json for tools and configurations that rely on it. (#23, @jaslong)
types field to package.json for tools and configurations that rely on it. (#23, @jaslong)Added a CommonJS bundle. (#18, @subtleGradient)
Combining atomic/possessive syntax with subroutines previously resulted in subroutines using capturing wrappers. This is now avoided when the regex do
{2}+) are now converted to greedy quantifiers (e.g. {2}), which gives the same behavior with faster-running generated regex source.subclass: true option could lead to incorrect values for submatches that preceded emulation groups, when used outside of the regex.Added support for possessive quantifiers.
This release focused on improving and simplifying the API for advanced options and plugins. With the new features, all JavaScript-based tools that pro
This release focused on improving and simplifying the API for advanced options and plugins. With the new features, all JavaScript-based tools that provide regex search or replace can now benefit from adopting regex.
__flagX, __flagN, __flagV, and __extendSyntax have been redesigned and renamed, and are now documented features via the new options disable: {x, n, v, atomic, subroutines} and force: {v}. The __rake option has been removed, and its behavior is now applied whenever flag <kbd>x</kbd> is enabled.RegExp constructor by modifying this has been removed.postprocessors as plugins.subclass: true results in numbered backreferences used outside of the regex automatically referencing their correct groups, in all contexts. The underlying issue is that emulating extended syntax (atomic groups and subroutines) sometimes requires adding anonymous "emulation group" captures to generated regex source. This was already mostly a non-issue because implicit flag <kbd>n</kbd> requires the use of named groups. This new option makes it safe to disable <kbd>n</kbd> and rely on group numbers while using extended syntax.unicodeSetsPlugin allows overriding or removing the built-in backward compatibility for environments without native support for flag <kbd>v</kbd>.[^\P{…}] with flag <kbd>i</kbd> in environments that don't natively support flag <kbd>v</kbd>, since the handling was incomplete and the syntax is not always problematic. New option unicodeSetsPlugin allows providing a more robust <kbd>v</kbd> transpiler, if needed.Added a browser-compatible ESM bundle, and updated exports to use it.
exports to use it.__extendSyntax, which defaults to the value of __flagN.(?:) is added to emitted regex source in fewer cases.(?:) in edge cases when doing so would make an invalid regex valid.Renamed function/tag partial as pattern.
partial as pattern.(?(DEFINE)…) at the end of a regex.Now works in environments without native flag v support, extending compatibility from Node.js 20 to 14, and from 2023-era to 2020-era browsers (2017-e
Removed deprecated exports make (an alias for regex) and default.
make (an alias for regex) and default.\g<name>.RegExp instance with a numbered backreference is preceded by an interpolated partial with captures.Added support for postprocessors, which can be used by extensions.
Renamed tag make as regex (#1). make remains available as a deprecated alias.
The library was renamed from Regex.make to just regex.
make as regex (#1). make remains available as a deprecated alias.Thanks @aaditmshah for npm package name regex!
Initial release.
Thanks @aaditmshah for npm package name regex!
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →