unstale

npm / re2js

re2js

What changed in re2js 1 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

5 breaking6 security13 new APIs and options5 performance4 behavior and defaults1 tooling21 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

re2js 243 changes

Breaking changes 3

  • Only Unicode groups are accepted.

    2.10.0release notes

  • Pass true for the new javaMode flag to opt into the previous Java-style escaping and invalid capture group exceptions.

    2.0.0release notes

  • replaceAll and replaceFirst now use native ECMAScript replacement semantics by default: $$ escapes a dollar sign, and backslash is treated literally.

    2.0.0release notes

Security 4

  • Additional checks are performed for inputs.

    2.10.0release notes

  • Fixes quadratic-time behavior when LOOKBEHINDS is used with repeated-matching APIs such as matcher().find() in a loop, matchAll(), split(), and matcher().replaceAll().

    2.8.7release notessecurity advisory

  • Includes small security fixes.

    2.8.7release notes

  • Fixed prototype pollution in getNamedGroups.

    2.1.1release notes

New APIs and options 8

  • Adds a new exec method.

    2.8.5release notes

  • RE2Set now supports customizing its memory limit.

    2.8.3release notes

  • Supports more Unicode categories, including Emoji, Emoji_Component, Emoji_Modifier, and ASCII_Hex_Digit.

    2.8.2release notes

  • replaceAll() now accepts a function as replacement in addition to a string.

    2.8.0release notes

  • replaceFirst() now accepts a function as replacement in addition to a string.

    2.8.0release notes

  • Added the matchAll method.

    2.6.0release notes

  • Added a tagged template literal method for constructing regular expressions.

    2.5.0release notes

  • RE2 lookbehinds are supported.

    2.2.0release notes

Performance 5

  • Removes O(n) array copying during UTF-8 encoding.

    2.8.6release notes

  • Optimizes the per-byte spawning loop for the LOOKBEHINDS flag.

    2.7.1release notes

  • Word boundaries are faster.

    2.3.2release notes

  • Added an Aho-Corasick prefilter.

    2.2.1release notes

  • Performance improvements for DFA may improve regular expression execution speed.

    2.0.1release notes

Behavior and default changes 4

Fixes and other changes 19

  • Fixes the type declaration for the re method after an issue introduced by the TypeScript 7 update.

    2.9.1release notes

  • The DFA now handles \b, \B, ^, $, \A and \z itself.

    2.8.8release notes

  • Fixes bugs in replace.

    2.8.6release notes

  • Fixes bugs in split.

    2.8.6release notes

  • Fixes the types for resetMatcherInput.

    2.8.5release notes

  • Fixes polymorphic inputs to resetMatcherInput.

    2.8.4release notes

  • Fixes TypeScript types for more methods.

    2.8.1release notes

  • Adds AST SyntaxError validation for the LOOKBEHINDS flag, helping identify invalid syntax.

    2.7.0release notes

  • Fixed a desynchronization bug in matchAll.

    2.6.1release notes

  • Fixes Unicode case folding across all JavaScript environments.

    2.4.0release notes

  • Fixes were made to the TypeScript declaration files.

    2.3.1release notes

  • TypeScript type fixes were made.

    2.3.0release notes

  • Fixes were made to translateRegExp().

    2.2.3release notes

  • Unicode fixes may change how regular expressions handle Unicode.

    2.2.3release notes

  • Fixes issues that cause “Maximum call stack size exceeded.”

    2.2.2release notes

  • Fixed a compiler memory leak.

    2.2.1release notes

  • Fixed onepass logic.

    2.2.1release notes

  • Zero-width matches no longer corrupt UTF-8 or UTF-16.

    2.2.1release notes

  • The RE2Set flags interface is fixed.

    2.2.0release notes

re2js 112 changes

Breaking changes 2

  • Escape parsing supports only ASCII values and reports an error for invalid escapes in a regex.

    1.0.0release notes

  • Adds parse-tree checks for regex height, runes and size so oversized or deeply nested regexes raise the same errors as original re2.

    1.0.0release notes

Security 2

  • Fixes information disclosure and XSS in Matcher.quoteReplacement.

    1.3.3release notes

  • Instance and static matches() methods use the testExact() DFA fast-path, providing a significant performance boost and ReDoS immunity.

    1.3.2release notes

New APIs and options 5

  • Adds high-performance boolean testing with test(), offering a faster alternative to matcher.find() for checking whether a pattern matches.

    1.3.1release notes

  • Adds a high-performance boolean testing method for exact matching.

    1.3.1release notes

  • Introduced lazy DFA.

    1.3.0release notes

  • Adds a Matcher export for TypeScript consumers.

    1.2.3release notes

  • Adds a method that provides a very approximate measure of a regexp's cost; larger values indicate more expensive regexps.

    1.0.0release notes

Tooling 1

Fixes and other changes 2