Skip to content
Tooldict

Regex Tester

Try your regular expression against text instantly; matches are highlighted in yellow, and you can run a find-and-replace if you want.

//
2 Matches
Today is 2024-05-18. Tomorrow is 2024-05-19.
. Any char
\w Word char
\d Digit
\s Whitespace
^ Start
$ End
* 0 or more
+ 1 or more
? 0 or 1
| OR
() Group
[] Range

About

Used to see where a pattern matches, count matches, and replace using capture groups ($1, $2). It uses the JavaScript regex engine and supports flags like g, i and m.

Everything runs in your browser; your text is never sent out.

How to use

  1. Type your regular expression in the pattern box (e.g. \d+).
  2. Enter flags such as g, i, m in the flags box.
  3. Type test text; matches are highlighted. Optionally fill the replacement field and copy the result.

Common regex patterns

Example regular expressions you can copy and try right away:

\d+
One or more digits. For capturing numbers, prices or codes.
[a-zA-Z]+
Letters only (no digits or symbols).
\w+@\w+\.\w+
A simple email pattern.
^\s+|\s+$
Leading and trailing whitespace (for trimming).
(\d{4})-(\d{2})-(\d{2})
A date (YYYY-MM-DD); access the groups with $1, $2, $3.
https?://[^\s]+
Captures links (URLs) inside text.

Frequently Asked Questions

Which regex syntax is supported?
JavaScript's RegExp syntax. Flags like g (global), i (case-insensitive) and m (multiline) are valid.
Can I replace using capture groups?
Yes. Use group references like $1, $2 in the replacement field.

Other tools

Embed this tool

Copy the code below and paste it into your site's HTML to embed this tool for free. The snippet includes an attribution link back to the source.

<iframe src="https://tooldict.com/embed/en/regex-tester" title="Regex Tester" width="100%" height="600" style="border:1px solid #e2e8f0;border-radius:16px;max-width:680px" loading="lazy"></iframe>
<p style="font:13px/1.5 sans-serif">Powered by <a href="https://tooldict.com/en/regex-tester" target="_blank" rel="noopener">Regex Tester</a> — Tooldict</p>