Regex Tester

Regex Tester

Test regular expressions against sample text live.

SEO Tools › Developer Utilities › Regex Tester

Test regular expressions against sample text live. It runs in your browser: nothing you paste is uploaded, there is no account, and the tool is free. It is built and maintained by SEO ProCheck.

Regular Expression Tester

A regex that looks right can still filter the wrong data

Regular expressions drive Search Console filters, analytics segments, crawler include and exclude rules, and redirect rules. One misplaced character can quietly match too much or nothing at all. This tester lets you try a pattern on sample text and see the result immediately, without touching a live report. It runs on the JavaScript engine built into your browser, and your text stays on your machine.

Step by step

  1. Enter the bare pattern in Regular Expression. Leave out delimiters, and do not double your backslashes the way you would inside a code string.
  2. Tick the flags you want. g is checked from the start and returns every match; i makes letters case insensitive; m lets ^ and $ work per line, which is useful when you test one URL per line.
  3. Add realistic data to Test String: real queries, paths or log lines work better than invented examples.
  4. Review the green count, the Matches list and the Highlighted panel. A red box means either no match or a syntax error with the reason.

What to watch for

JavaScript regex is richer than the RE2 engine behind Google Search Console and Looker Studio. Lookarounds such as (?=...) and backreferences such as \1 run fine here and fail there. If the pattern is headed for one of those tools, avoid those features even when this page accepts them.

Turning off g limits the output to the first match. The tester does not list capture groups, so if you rely on groups for an extraction or a replacement, verify them in the target tool. Zero-width patterns produce empty matches that still add to the count, so a large number next to an empty-looking list usually means your pattern can match nothing.

Only three flags are available. For dotAll behavior, use [\s\S] in place of the dot. Highlighting is done on an HTML-escaped copy of the text, so searches for angle brackets or ampersands can show matches in the list that are not marked in the preview.

Questions people ask

Why does my regex work here but not in Search Console?

Search Console uses RE2, which leaves out lookarounds and backreferences. Rewrite the pattern without them, for example by using a second exclude filter.

Is matching case sensitive?

Yes, unless you tick i. Search Console patterns often start with (?i) for the same purpose, but JavaScript rejects that prefix as an invalid group, so remove it when testing here and tick i instead.

Does it support named groups?

Your browser will accept them, but the results only show whole matches, so you will not see what each group captured.

Further reading: Building SEO Dashboards in Looker Studio That People Actually Use and Screaming Frog: Advanced Usage Guide.

The same tool is also published on the static mirror at seoprocheck.github.io, and the rest of the set is on the free tools page.