Skip to tool
Text

RegExp Tester

Test JavaScript regular expressions with groups, indices, and replacement output.

Input0 characters
Reference0 characters
Result0 characters
Ready

Prefer a native workflow?

Keep RegExp Tester one shortcut away.

DevSexy for Mac puts the same private workflow in a focused desktop app, with global shortcuts and no browser tab to manage.

Global shortcutOffline-readyLocal processing
Try the Mac app free

This browser tool remains free.

JavaScript engine tape trace · flavor declared

A match is a span, state, and engine decision.

Patterns do not have one universal meaning. This bench follows the running browser’s ECMAScript RegExp semantics and reports indices, captures, flags, and replacement behavior as execution evidence.

JS

ONLY

PATTERN/(?<proto>https?):\/\/(?<host>[^/:\s]+)(?::(?<port>\d+))?/dguINPUTVisit https://example.com:8080/docs next.
0V
1i
2s
3i
4t
5·
6h
7t
8t
9p
10s
11:
12/
13/
14e
15x
16a
17m
18p
19l
20e
21.
22c
23o
24m
25:
268
270
288
290
30/
31d
32o
33c
34s
MATCH 0 · [6, 35)proto · [6, 11)host · [14, 25)port · [26, 30)

Flag state machine

Flags change meaning and iteration—not decoration.

d

Indices

Adds start/end spans for the match and captures

g

Global

Repeats and mutates lastIndex

i

Ignore case

Uses the engine’s case-folding rules

m

Multiline

^ and $ also see line boundaries

s

Dot all

. can include line terminators

u

Unicode

Code-point-aware parsing and escapes

v

Unicode sets

Set operations and string properties

y

Sticky

Must match exactly at lastIndex

Capture ledger

Unmatched is different from an empty match.

0 · full[6, 35)https://example.com:8080/docsparticipated
1 · proto[6, 11)httpsparticipated
2 · host[14, 25)example.comparticipated
3 · port[26, 30)8080participated
4 · optional—undefinedunmatched

Native replacement proof

The template has its own language.

ORIGINALVisit https://example.com:8080/docs next.
TEMPLATE$<proto>://$<host>$<path>
RESULTVisit https://example.com next.
$& · full match$1 … $99 · numbered capture$<name> · named capture$$ · literal dollar$` / $' · prefix / suffix

Backtracking isolation chamber

Responsive UI is not proof of a safe pattern.

/^(a+)+$/aaaaaaaaaaaaaaaaaaaaaaaaaaaa!

A run owns a dedicated Worker. Starting another run terminates the previous one, so the main page can keep responding. Production safety still depends on input distribution, engine, pattern structure, and resource policy.

Run a reproducible example

Inspect named captures and use the same groups in a replacement under the browser’s ECMAScript engine.

Using an example replaces the current input, reference input, operation, and options. Public demonstration data only.

Find two named capture pairs

ECMAScript with g for iteration and d for capture indices.

Input

(?<name>[A-Za-z]+)=(?<count>\d+)

Reference

Ada=17 Lin=2

The report finds Ada=17 and Lin=2 and exposes the name/count groups.

Matches: 2
<name> "Ada"
<count> "17"

Reorder groups in every match

Use g, Replace all, and the named replacement $<count>:$<name>.

Input

(?<name>[A-Za-z]+)=(?<count>\d+)

Reference

Ada=17 Lin=2

The replacement changes each pair to count:name while preserving the separating space.

17:Ada 2:Lin

Continue with a related task

Text Escapes & Unicode Inspector

Inspect code points, normalization, graphemes, and language escape sequences.

Text Diff

Compare two texts by line, word, or character in a local worker.

JavaScript Beautifier & Minifier

Format or compress JavaScript with parser-backed diagnostics.

Repeat the task in DevSexy for Mac

Use the native app for repeated offline work and direct Option shortcuts.

Direct answer

What is RegExp Tester?

Test regular expressions online with the browser’s JavaScript engine, inspect spans and captures, preview replacement tokens, and isolate runaway work in a replaceable Worker.

What can it do?

  • Match
  • Replace

How to use RegExp Tester

  1. 01

    Prepare the input

    Put the expression in the first pane and sample text in the reference pane.

  2. 02

    Choose the operation

    Set ECMAScript flags and choose Match or Replace with an explicit replacement.

  3. 03

    Review the evidence

    Inspect capture ranges and test edge cases; do not assume another regex engine behaves identically.

Frequently asked questions

Is this a PCRE or ICU regex tester?
No. The website uses the running browser’s ECMAScript RegExp implementation. PCRE and native ICU syntax or behavior cannot be assumed to match.
Why does only the first match appear?
Without g or y, execution uses first-match semantics. Enable the appropriate flag when you want iteration, and consider zero-width behavior when reviewing ranges.
Are match positions byte offsets?
No. JavaScript string ranges use UTF-16 code units. Emoji and some other characters occupy two units; inspect Unicode text separately if your consumer expects bytes or scalar positions.