S SEO ProCheck Tools seoprocheck.com →
← All tools

Regex Tester

Test regular expressions against sample text live.

Regular Expression Tester

What it does

This page tests a regular expression against sample text as you type. It uses your browser's JavaScript regex engine and shows how many matches it found, lists each matched string, and highlights the matches inside your text. If the pattern is invalid, you see the browser's error message instead. Nothing is uploaded; the test runs locally.

How to use it

  1. Type the pattern into Regular Expression without the surrounding slashes. Write \d+, not /\d+/, and use single backslashes.
  2. Set the Flags: g (all matches, on by default), i (ignore case) and m (make ^ and $ match at the start and end of each line).
  3. Paste sample text into Test String, such as a list of URLs or queries.
  4. Read the result: a match count, the list of matches and the highlighted copy of your text. It refreshes a quarter second after you stop typing.

A match here is not a match everywhere

Different tools use different regex engines. Google Search Console and Looker Studio use RE2, which does not support lookaheads, lookbehinds or backreferences. A pattern with (?!...) can work perfectly on this page and be rejected in Search Console, so keep patterns you plan to use there to features RE2 supports.

A few details of this tester matter when you read its results. With g turned off, only the first match is reported. The list shows full matches only, not capture groups. Patterns that can match nothing, such as a*, count every empty match, which inflates the total. The dotAll (s), unicode (u) and sticky (y) flags are not offered. And the highlighted view runs on an escaped copy of your text, so a pattern that looks for <, > or & may appear in the match list without being highlighted.