Regex Tester

Test JavaScript regular expressions with live match highlighting.

  • Free
  • No sign-up
  • Runs in your browser
  • Developer
Use the tool

Why use it

Write a pattern, paste sample text and see every match highlighted as you type, with capture groups listed below. Use it to check validation rules, parse log files or build redirect patterns before they go into code.

Live highlighting

Matches are highlighted in your test text as you type the pattern.

Capture groups

Numbered and named groups are listed for every match.

Replace preview

Try a replacement string, including $1 and $<name> references, before using it in code.

How to use it

4 quick steps. Going deeper? Read WordPress plugin development: structure, hooks and security done right.

  1. 01

    Enter the pattern without surrounding slashes.

  2. 02

    Toggle flags: g (all matches), i (ignore case), m (multiline), s (dot matches newline), u (Unicode).

  3. 03

    Paste test text; matches highlight instantly and groups appear in the table.

  4. 04

    Optionally enter a replacement (use $1, $2 or $<name>) to preview the result.

Who it’s for

Typical situations where this tool saves time.

  • PHP and JavaScript developersBuild validation patterns for SKUs, phone numbers or IDs and test them on real data.
  • Site maintainersPull fatal errors out of long debug logs.
  • SEO specialistsCheck redirect patterns before adding them to .htaccess or Nginx.

Questions

Short answers about privacy, limits and how the tool works.

Which regex flavour does this use?

JavaScript (ECMAScript) regular expressions, the same engine used in browsers and Node.js. Most patterns also work in PHP's PCRE, but lookbehind and named-group syntax can differ.

Why does my pattern only find one match?

Without the g flag, JavaScript stops after the first match. Turn on g to find all matches.

Can a pattern freeze the page?

Badly nested quantifiers can backtrack for a long time. The tester caps the number of matches, but avoid patterns like (a+)+ on long text.

Need a tool like this inside your product?

I build custom calculators, admin utilities and integrations for WordPress, Laravel and Next.js teams.

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Ctrl+K
Search tools, articles and projects
/
Search
[
Previous lesson (on articles)
]
Next lesson (on articles)
T
Switch light / dark theme
GthenH
Go to the home page
GthenT
Go to the tools
GthenA
Go to the articles
?
Show this list