9 features × 8 engines · live · notes

Feature × engine regex compatibility matrix

See exactly which regex feature works in JS, PCRE, Python, Java, .NET, Go, Ruby, and Rust. Hover any cell for engine-specific notes.

Regex Flavour Matrix
Features
9
tracked
Engines
8
compared
Supported
47
yes cells
Unsupported
18
no cells
matrix · features × engines
FeatureJSPCREPythonJava.NETGoRubyRust
Named groupsokokokokokokokok
Lookaheadokokokokoknookno
Lookbehindokpartialpartialpartialoknopartialno
Atomic groupsnookpartialokoknookno
Possessive quantifiersnookpartialoknonookno
Unicode \p{}okokpartialokokokokok
Inline flags (?i)nookokokokokokok
Backreferencesokokokokoknookno
Conditionalsnookoknooknookno
notes · per-cell details
Named groups
JS ok
(?<name>…) since ES2018
PCRE ok
(?<name>…), (?P<name>…), (?'name'…)
Python ok
(?P<name>…)
Java ok
(?<name>…) since 7
.NET ok
(?<name>…)
Go ok
RE2: (?P<name>…)
Ruby ok
(?<name>…)
Rust ok
regex crate: (?P<name>…) or (?<name>…)
Lookahead
JS ok
(?=…) and (?!…)
PCRE ok
Full support
Python ok
Full support
Java ok
Full support
.NET ok
Full support
Go no
RE2 forbids lookaround (linear-time guarantee)
Ruby ok
Onigmo: full support
Rust no
regex crate is RE2-style; no lookaround
Lookbehind
JS ok
(?<=…), (?<!…) since ES2018; variable-width allowed
PCRE partial
Fixed-width; \K is the modern alternative
Python partial
Fixed-width in re; full in regex module
Java partial
Fixed-width; some impls allow bounded
.NET ok
Variable-width allowed
Go no
Not supported
Ruby partial
Onigmo: variable-width but with limits
Rust no
Not supported in standard regex crate
Atomic groups
JS no
Not supported in V8/SpiderMonkey
PCRE ok
(?>…)
Python partial
regex module yes; built-in re only in 3.11+
Java ok
(?>…)
.NET ok
(?>…)
Go no
RE2: not needed (no backtracking)
Ruby ok
(?>…)
Rust no
RE2-style: no atomic groups
Possessive quantifiers
JS no
Not in spec
PCRE ok
*+ ++ ?+ {n,m}+
Python partial
regex module yes; re in 3.11+
Java ok
Full support
.NET no
Not supported (use atomic groups)
Go no
RE2: not applicable
Ruby ok
Onigmo: supported
Rust no
Not supported
Unicode \p{}
JS ok
With u flag; \p{Script=…} requires modern engines
PCRE ok
With UCP
Python partial
re: limited; regex module: full
Java ok
Pattern.UNICODE_CHARACTER_CLASS
.NET ok
\p{IsBlock} and Unicode categories
Go ok
RE2: full Unicode property classes
Ruby ok
Onigmo: full support
Rust ok
regex crate: full Unicode support
Inline flags (?i)
JS no
Not supported (flags only on RegExp object)
PCRE ok
(?i), (?-i), scoped (?i:…)
Python ok
(?i), (?aiLmsux)
Java ok
(?i), (?-i), scoped (?i:…)
.NET ok
(?i), (?-i), scoped (?i:…)
Go ok
(?i), (?m), (?s), (?U)
Ruby ok
(?i), (?-i), scoped
Rust ok
(?i), (?x), (?m), (?s), (?U)
Backreferences
JS ok
\1, \k<name>
PCRE ok
\1, (?P=name), \g{name}
Python ok
\1, (?P=name)
Java ok
\1, \k<name>
.NET ok
\1, \k<name>
Go no
RE2 forbids backrefs (linear time)
Ruby ok
\1, \k<name>
Rust no
Not supported in regex crate
Conditionals
JS no
(?(cond)yes|no) not supported
PCRE ok
(?(1)yes|no), (?(<name>)yes|no)
Python ok
(?(id/name)yes|no)
Java no
Not supported
.NET ok
(?(expr)yes|no)
Go no
Not supported
Ruby ok
Onigmo: (?(cond)yes|no)
Rust no
Not supported
Quick Start

How to read the flavour matrix

Each row is a feature; each column is a regex engine. The cells say whether it works.

  1. 01

    Scan rows

    Nine of the most-asked-about features.

    Rows cover the high-impact differentiators — named groups, lookbehind, atomic groups, possessive quantifiers, Unicode property escapes — the ones that decide whether a port to RE2 or POSIX will work at all.

    navfeaturesportabilitymatrix
    rows · indexed9 · features
    Named groups
    Lookahead
    Lookbehind…
    loaded · indexedECMA · ready
  2. 02

    Compare columns

    JS, PCRE, Python, Java, .NET, Go, Ruby, Rust.

    Columns include ECMAScript, PCRE, re (Python), java.util.regex, .NET Regex, Go RE2, Onigmo (Ruby), and the Rust regex crate.

    compareenginesPCRERE2
    config · engines8 · flavours
    JS  PCRE  Python…
    flags applied · liveECMA · live
  3. 03

    Inspect cells

    ok / partial / no per cell. Hover for notes.

    Partial means the feature exists but with caveats — Go RE2 has no backreferences at all, Java’s lookbehind requires a bounded width, and PCRE supports recursion that JS does not.

    readok/partial/nocaveatsRE2
    run · cellGo · no
    Lookahead — Go: no
    matches · livediff · live
  4. 04

    Copy or share

    Copy as TSV for spreadsheets or docs.

    TSV pastes cleanly into Notion, Google Sheets, or a markdown table — useful when documenting a regex porting effort across two languages.

    shareTSVclipboarddocs
    export · TSVmatrix · saved
    ✓ Copied
    ready to shipsuccess
Pro tips

Regex patterns that don't melt down

Use named groups

(?<year>\d{4}) reads better than $1 and survives reordering. Supported in ECMAScript 2018+.

Anchor strictly

Use ^/$ with the m flag when matching whole lines. Without anchors, partial matches sneak through.

Avoid catastrophic backtracking

Nested quantifiers like (a+)+ can explode. Run patterns through ReDoS Detector first.

Escape every literal

Backslash any meta character you want literally: \.\$\^\*\+\?\(\)\[\]\{\}\|\\.

Test edge cases

Empty string, single character, unicode, the maximum length you expect — write fixtures for each.

Patterns aren&rsquo;t parsers

Don’t parse HTML, JSON, or balanced parens with regex. Use a proper parser when the grammar is recursive.

Use Cases

When to consult the matrix

Engineers writing portable regex or picking a stack.

Pick a stack

Need lookaround? Skip Go and Rust's default regex. Compiles through the JavaScript RegExp constructor — engine quirks (Unicode property escapes, sticky matching, named groups) work when their flags are on. Error messages cite the exact position of any syntax issue.

ReDoS-safe

Audit portability

Will this regex run unchanged in production? Pairs with the ReDoS detector to catch catastrophic backtracking before you deploy. A pattern that handles 1k-character input fine can become a denial-of-service vector on attacker-controlled 1M-character input.

ECMA-compliant

Code review

Sanity-check a fancy feature before merging. Output exports as JavaScript, Python re, Java util.regex, .NET System.Text.RegularExpressions, PCRE, and POSIX — language quirks are highlighted on conversion so you don't ship a JS-only pattern to a Go service.

spec-grade

Document

Cite the matrix when discussing regex options. Capture groups (named or numbered) round-trip cleanly into replacement strings, JSON output, or CSV extraction without re-typing. Backreferences ($1, ${name}) preserve semantics across languages.

cross-engine

Teach

Single page covers cross-engine differences. Test against edge cases — empty input, single character, max length, multibyte boundaries — to catch off-by-one and zero-length match bugs before they reach production.

test-ready

Migrate

Plan a rewrite when changing languages. All matching runs client-side so secret patterns never leave the browser. Useful when the pattern itself is sensitive (PII regexes, internal data formats, security filters).

production-ready
FAQ

Frequently asked questions

Go's regexp package uses RE2 which guarantees linear-time matching. That precludes backreferences, lookaround, and atomic groups.
Same trade-off — the default `regex` crate is RE2-style. Use `fancy-regex` for backtracking features.
No proposal currently. Polyfill via possessive equivalents or use d flag for indices.
Engine supports the feature with caveats — version requirement, fixed-width only, or behind a flag.
No. The matrix is static — renders entirely in your browser.
Suggest a tool

Something missing?

Tell us what you need. We ship the top requests every two weeks.

Sent straight to the maintainers · no account needed
47 in queue·8 shipped this month
Request queued. Thanks!