find_replaceText

Regex Tester

Write a pattern, paste some sample text, and watch the matches highlight as you type. Capture groups and named groups are listed per match, and a cheat sheet sits alongside for the syntax nobody remembers.

RegExpMatchGroups

find_replace Pattern

//g

notes Test text

highlight Highlighted

Contact richard@example.com or support@example.co.uk. Invalid: not-an-email@, @nope.com Another: hello@richardgaskin.co.uk
Matches
3
Flags
g
Groups
3
Characters
122

format_list_numbered Matches (3)

Match 1 index 8–27richard@example.com
$1richard
$2example
$3com
Match 2 index 31–49support@example.co
$1support
$2example
$3co
Match 3 index 97–119hello@richardgaskin.co
$1hello
$2richardgaskin
$3co

menu_book Cheat sheet

.
Any character except a newline
\d \w \s
Digit, word character, whitespace
\D \W \S
The negation of each of the above
[abc]
Any one of a, b or c
[^abc]
Any character that is not a, b or c
^ $
Start and end of the string (or line with m)
\b
A word boundary
* + ?
Zero or more, one or more, zero or one
{2,5}
Between two and five times
*? +?
The lazy form — match as little as possible
(abc)
A capture group
(?:abc)
A group that does not capture
(?<name>…)
A named capture group
a|b
Either a or b
(?=…) (?!…)
Lookahead: followed by / not followed by
(?<=…) (?<!…)
Lookbehind: preceded by / not preceded by

What this tool does

  • check_smallLive highlighting of every match as you type
  • check_smallAll JavaScript flags — g, i, m, s, u, y, d
  • check_smallPer-match index, capture groups and named groups
  • check_smallReplace mode with $1-style substitution preview
  • check_smallReadable errors for invalid patterns, plus a syntax cheat sheet

Privacy

This tool runs entirely in your browser using client-side JavaScript. Whatever you paste stays on your machine — there is no back end, no upload and no analytics on your input.

Next tool

arrow_back All tools