{ }jsonkit
Format
Validate
Convert
Query
Generate

Regex tester

Live matches, named groups and capture details as you type.
$live results as you type · ⌘↵ to re-run
324 B · paste or drop a file
1 2 3 4 5
✓ complete324 B → 852 B0.0 ms

About Regex Tester

The regex tester runs a regular expression against your sample text and shows every match as structured JSON while you type. Check that a pattern does what you expect before you put it in code.

Each match lists its text, index, numbered captures and named groups. Runs in your browser with the native JavaScript regex engine. Nothing is uploaded.

How it works

Pattern in the query bar, text in the pane

Type your regular expression in the query bar and paste the test text in the input area. A bare pattern like ([a-z]+)@(\w+) works, and so does a /pattern/flags literal like /error/gi. Flags in a literal are merged with the toggles.

Flags: g, i, m, s

Global (g) finds every match instead of the first. Ignore case (i) makes the pattern case-insensitive. Multiline (m) lets ^ and $ match at line breaks. Dot-all (s) lets . match newlines.

Reading the match output

Each match reports the matched text, its index in the input, a captures array and a groups object for named groups like (?<user>...). matchCount gives the total. Output stops at 1000 matches.

Named groups and captures

Parentheses create capture groups, returned in order in captures. Add a name with (?<name>...) and the value also appears under groups by that name. Use this to pull fields like a user and host out of an email, or a date out of a log line.

Frequently asked questions

How do I test a regex online for free?

Paste your text into the input pane and type your pattern in the query bar. Matches appear as structured JSON right away. There is no account and no cost.

How do I use named groups in regex?

Wrap the part you want in (?<name>...), for example (?<user>[a-z]+)@(?<host>\w+). Each match's groups object then has user and host keys, next to the numbered captures array.

Why does my regex loop forever or hang?

Usually catastrophic backtracking. Nested or overlapping quantifiers like (a+)+ or (.*)* make the engine try an exponential number of paths, especially on input that almost matches. Make quantifiers more specific, avoid nesting them, and prefer character classes to a broad dot. The 1000-match cap keeps output readable but cannot stop a pathological pattern from freezing the tab.

Can I paste a /pattern/flags literal?

Yes. A bare pattern and a /.../ literal both work. Flags in the literal, such as /foo/gi, are merged with the g, i, m and s toggles.

Is my test text or pattern sent to a server?

No. Matching runs in your browser, and nothing is uploaded, logged or stored.

Sources & last verified

We checked this tool's behavior and the claims on this page against the specifications below on . The tool runs in your browser, so the output you see is exactly what the engine produced.

Found a wrong result or an outdated claim? Report an error and we will check it again.