Skip to content
Free developer tool

Regex tester

This regex tester runs a JavaScript regular expression against your text and lists what it matches. Developers use it to build and debug patterns for validation, search and replace, and log parsing.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result

Your input

49 characters

No surrounding slashes
Any of g i m s u v y d
Optional; $1, $<name> and $& work

Result

Matches3
Pattern
/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/g
First match
"2026-10-29" at index 11
After replace
Deadlines: 29/10/2026, 05/11/2026 and 15/01/2027.
MatchIndexLengthTextGroups
11110"2026-10-29"year "2026", month "10", day "29"
22310"2026-11-05"year "2026", month "11", day "05"
33810"2027-01-15"year "2027", month "01", day "15"

The short answer

A regular expression is a pattern that describes text, and testing it shows every match with its position and any captured groups. Here the pattern runs on the JavaScript engine, so flags such as g (all matches), i (ignore case) and named groups work as they do in JavaScript code.

Worked exampleThe pattern (?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2}) with the g flag finds 3 dates in the sample, starting with 2026-10-29 at index 11; replacing with $<day>/$<month>/$<year> gives 29/10/2026, 05/11/2026 and 15/01/2027.

Example

Input
Deadlines: 2026-10-29, 2026-11-05 and 2027-01-15.
Result
Matches3
Pattern
/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/g
First match
"2026-10-29" at index 11
After replace
Deadlines: 29/10/2026, 05/11/2026 and 15/01/2027.
MatchIndexLengthTextGroups
11110"2026-10-29"year "2026", month "10", day "29"
22310"2026-11-05"year "2026", month "11", day "05"
33810"2027-01-15"year "2027", month "01", day "15"

How to use the regex tester

  1. Enter your Pattern without the surrounding slashes, and any Flags such as g or i.
  2. Paste the text to search into the Test text box.
  3. Optionally fill in Replace with to preview a replace.
  4. Read the match count, the match table and the replaced text as they update. Copy result or Download saves them.

How it works

Patterns run on the JavaScript regular expression engine in your browser, so lookbehind, named groups and the u and v flags work as they do in JavaScript.

The result leads with the match count, then a table of every match with its index (in UTF-16 code units), length, text and groups, named where the pattern names them. Without the g or y flag only the first match is listed.

Replace with supports $1, $<name>, $&, $`, $' and $$, the same patterns as JavaScript's replace. The example turns dates into day/month/year.

Limits: patterns up to 1,000 characters, test text up to 100,000 characters and at most 1,000 listed matches.

Complex patterns with nested repeats, such as (a+)+, can be very slow on some text and may freeze the page.

Everything runs in your browser. Your input is not uploaded or stored. If you use Copy link, what you entered is placed in the link.

Questions and answers

Why do I only see one match?

Add the g flag. Without it, JavaScript stops after the first match.

How do I use a named group in the replacement?

Write (?<name>...) in the Pattern and $<name> in Replace with, for example $<day>/$<month>/$<year>.

Does this work for Python or PCRE patterns?

It uses JavaScript rules. Most basic syntax is shared, but other engines support features JavaScript does not, such as possessive quantifiers, so test there too.

Why does the page hang on my pattern?

Some patterns, such as (a+)+$, take exponential time when a match fails. Rewrite nested repeats so each part of the text can be matched in only one way.

Last updated November 1, 2026. Maintained by SnowRock. How our tools work

All 220 SnowRock tools