Formatters & Code

Regex Tester

Test regex, inspect matches and groups, and replace or extract text. Save patterns, compare engines and process files privately in your browser.

Enter your expression without surrounding slashes.

Flags & matching options

g: all matches (enabled by default) · i: ignore case · y: sticky from position 0 · u/v: mutually exclusive Unicode modes

Matches are highlighted in your test text.

Test cases

Check your pattern against expected results.

Expected result / unit test

Full-match and group expectations check the first match only. Group values are compared exactly; unmatched does not equal empty.

Review recorded expectations for correctness. Captures use a JSON array without group 0; null means unmatched. Count/all-match/output assertions are inconclusive when results are partial. Output assertions use the selected operation.

Exports use the selected engine. JavaScript, Rust, Java, .NET and Go use Node 22+ launchers; Java/.NET/Go also require their SDK. Python uses unittest. PCRE2 exports test evidence JSON. Unasserted or incomplete cases are skipped explicitly.

Saved work

Keep a workspace or reuse a named pattern.

Pattern library & examples

Store up to 30 named workspaces locally. Entries include samples and assertions. Saving an existing name updates it. Exports contain private text. Examples demonstrate syntax, not complete email or calendar validation.

Build & process

Create patterns, work through files, and clean CSV data.

Builder & code

Build an escaped alternation from literal values. Blank lines are ignored, duplicates removed, spaces preserved. Order is preserved: earlier alternatives win. Anchors follow the current flags, including multiline behavior.


      
Batch files & output

Import text files as separate samples (20 total, 20,000 UTF-16 units each). Run the selected operation across all samples. ZIP includes per-sample output and a manifest with errors, assertions and partial-result status.


      
CSV cleanup recipes

Chain up to 10 replacement or extraction steps on one CSV column. Set each step in the editor, then add it here. Original input is preserved. Preview changes before downloading. Up to 500 rows, 100 columns and 200,000 input characters.


        
        
CSV download options

Adds an apostrophe before values Excel might read as formulas. Turn this off for unchanged values. This preference applies to all CSV downloads.


      

Advanced testing

Step through matching and use engine-specific test tools.

Execution debugger · PCRE2

Record real PCRE2 auto-callout events for the active sample, then step through matcher positions, backtrack events and captures. Uses the PCRE2 flags above. Traces the first search only, even with g. Start optimizations and auto-possessification are disabled to expose matcher behavior; this is a diagnostic run, not a speed benchmark.

Offsets are UTF-16. Up to 2,000 events and snapshots of the first 16 captures. Reaching a limit aborts the match and is not a no-match verdict. Pattern and text highlights follow the selected event. Exports include private input and the recorded event sequence.

Language runtimes

Run the editor pattern, operation and assertions with CPython re, Rust regex, Go regexp or .NET Regex in local WebAssembly runtimes. Java runs OpenJDK 21 through CheerpJ 5.0. Java runtime files load from the CheerpJ CDN when you run Java; other runtimes load from this site. Patterns and samples stay on your device.

g selects all matches. Python flags: i/m/s/x/a/u; replacement uses Python backslash and group-reference rules. Rust flags: i/m/s/x/U/u (Unicode on by default); replacement uses $1 and $name and currently requires g. Match, replacement and split are supported; extraction templates remain JavaScript-only. Python split retains captures; Rust split omits them. UTF-8/code-point spans are converted to UTF-16 for comparison.

Go flags: i/m/s/U; no lookaround or backreferences. .NET flags: i/m/s/x/n/r/e/b (explicit capture, right-to-left, ECMAScript, nonbacktracking); invariant culture. Java flags: i/m/s/x/u/U/d/l/c (Unicode case, Unicode classes, Unix lines, literal, canonical equivalence). These engines use $1 and ${name} replacement references. .NET split includes captures; Go and Java omit them, and Java drops trailing empty fields. .NET reports repeated capture history and actual group numbers.

Built with CheerpJ. Java loading contacts its CDN (including your IP address) and requires internet access. Loading has a separate 60-second deadline for Java and 30 seconds for other runtimes; execution uses the selected 500/750/1,000 ms deadline. Editing or choosing Stop test ends the current run. .NET also has a 500 ms native match timeout. Each report identifies its engine. Java, .NET and Go exports compile the included runner on your machine using Node 22+ and the relevant SDK, then run assertions with per-case process deadlines. Go exports compile to official Go WASM under Node; Java and .NET use native runtime processes. Python exports use CPython; Rust exports use the pinned WASM package. Errors and timeouts never pass a negative test.

Compare engines

Check compatibility and investigate performance.

Compare all seven engines

The selected editor engine is the baseline. Each engine uses its own flags below; pattern, replacement, mode and assertions are identical. Syntax is never translated. Comparing includes Java and loads its runtime from the CheerpJ CDN. Errors, timeouts, partial results and unavailable spans are reported separately.

Compare engines & performance

Runs the same pattern against every sample using native JavaScript and RE2JS. Comparison supports g/i/m/s only; unsupported flags are reported, not removed. Compare captures and UTF-16 spans, including Unicode differences. This is not a Google backend test or a universal converter.

PCRE2 10.49 WebAssembly: uses the editor pattern, Match or Replacement operation and assertions, with separate flags g/i/m/s/x/u/U/A/D. UTF is always on; UCP is off unless requested in the pattern. PCRE2 dollar/backslash replacement rules differ from JavaScript. Match limit 100,000, depth limit 500, plus the selected worker deadline. Capture values and positions come from the native PCRE2 offset vector. Export analysis saves PCRE2 results; runnable Node exports test native JavaScript only. PCRE2 license notices.


        

All runs share the selected worker deadline. A timeout cancels the entire job; it never counts as no match. Syntax hints and the Explanation tree are static analysis, not a backtracking trace.

What the result means

Write a pattern, add test text, and inspect the highlighted matches and captured values. Switch the operation to replace, extract or split text. Test cases let you check expected results, while Saved work keeps patterns ready to reuse. Builders, file processing and engine comparisons have their own panels below. Stop test keeps your inputs, while Clear workspace removes the current inputs and saved draft. Named library entries remain available. Your work stays in this browser; downloaded files include your test text.

Related tools

Guides

Advertisement

Questions

Which regex engine is used?

Choose JavaScript, PCRE2, Python, Rust, Go, .NET or Java to match your application. Syntax, flags and replacement rules vary by engine. Java loads its runtime from the CheerpJ CDN; other runtime files load from PageUtil. Matching runs in your browser.

Does my test text leave my device?

Patterns and test strings are processed locally. Drafts are saved in browser storage on this device. Clear workspace removes that saved workspace. JSON downloads contain your test texts, so inspect them before sharing.

Can a slow regex freeze the page?

Use Stop test to end a running test while keeping your inputs. Tests also stop when you edit or when the time limit is reached. A stopped test is not a no-match result.

Need help with a tool or found a bug?

Report an issue directly to engineering. No accounts required — all client data remains private on your device.

Report an Issue →