Regex Tester

Regex Tester

Use our free regex tester to test regular expressions online, without installing anything. This regular expression tester shows live matches, positions, capture groups and replacement results as you type, so you can check a pattern before you use it for real. It runs entirely in your browser.

g = all matches, i = ignore case, m = multiline, s = dot matches new lines

Character Count: 0 Word Count: 0 Matches: 0

Type a pattern and test text — matches update as you type. Your text stays in your browser and is not uploaded or stored.

How to use the Regex Tester

  1. Type or paste your pattern in the pattern box.
  2. Choose the regex flags you need, such as g for all matches or i to ignore case.
  3. Paste your test text and read the matches, positions and capture groups.
  4. Add a replacement to see the full result, for example for a redirect-style rewrite.

Why use a regex validator?

  • Check patterns quickly with this regex match tester, instead of guessing whether they work.
  • Use JavaScript regex, the same flavour used in web development and many analytics tools.
  • Understand regex flags, including g, i, m and s, and see how each one changes the result.
  • Inspect capture groups and test replacements before using a pattern for redirects and URL matching.
  • Keep your test text private, because nothing is uploaded or stored.

Related tools

Frequently asked questions

c Expand All C Collapse All

Yes. Type a replacement in the replacement box and the tool shows the full test text after the replacement is applied, so you can check a find-and-replace or a redirect-style rewrite before you use it for real.

No. The regex tester runs in your browser and your pattern and text are not uploaded or stored.

Parts of a pattern inside brackets are capture groups. The tester shows the value of each group next to every match, and in the replacement box you can use $1, $2 and so on to place those group values in the new text.

The g flag finds all matches instead of stopping at the first one. The i flag ignores upper and lower case. The m flag makes ^ and $ work at the start and end of each line, and the s flag lets a dot match new lines as well.

A regular expression, or regex, is a pattern that describes text to find — for example all email addresses in a paragraph, or all numbers in a line. Developers and SEO professionals use regex for searching text, checking formats, building redirects and filtering reports.

This tool uses JavaScript regular expressions, because it runs in your browser. That is the same regex flavour used in web development and in many analytics and tag tools, although some other tools and languages use slightly different rules.

An error usually means the pattern is incomplete or has a character in the wrong place — for example an unclosed bracket or bracket group. Fix the pattern step by step, adding one part at a time, until the error disappears.