🔒 100% private — runs in your browser, nothing is uploaded

Regex Tester

Test, check and validate regular expressions with live highlighting.

Regular expressions are the power tool for searching and validating text — emails, phone numbers, log parsing.

Read the guide: Regex Basics: Read and Write Patterns That Actually Match

How to use

  1. Type your pattern — it is tested as you type.
  2. Toggle g / i / m flags as needed.
  3. Matches highlight yellow in your test text.

About this tool

This tester uses JavaScript regex syntax, the same flavor that runs in browsers and Node.js.

Your pattern and test text never leave your browser.

Form keeps rejecting your input? Paste the value as test text and use this as a regex checker: if the pattern highlights it, the string validates — and the match count shows exactly what matched.

How it works

A regular expression is a pattern in a compact notation: literal characters match themselves, . matches any character, \d a digit, \w a word character, \s whitespace. Quantifiers control repetition — * (zero or more), + (one or more), ? (zero or one), {2,4} (between 2 and 4).

Anchors ^ and $ pin the match to the start and end of the string. Without them, \d+ matches 'abc123' because it finds digits anywhere; ^\d+$ only matches strings that are entirely digits.

Parentheses ( ) group parts of the pattern and capture them for reuse, | means 'or', [abc] matches one listed character, [^abc] matches anything except those, and [a-z] matches a range.

Worked examples

Validating an email field: Test ^[^\s@]+@[^\s@]+\.[^\s@]+$ against input as the user types — 'not an email' is rejected instantly, before the form is ever submitted.

Pulling dates out of text: Run (\d{4})-(\d{2})-(\d{2}) over 'shipped 2024-03-15' to capture year, month, and day as three separate groups.

Quick reference

PatternMatches
^\d+$A string that is only digits
^[^\s@]+@[^\s@]+\.[^\s@]+$A basic email address
^\+?[\d\s-]{7,}$A phone number
^\d{4}-\d{2}-\d{2}$A date like 2024-03-15
^https?://An http:// or https:// URL
\b\w+\bEach word in the text

Frequently asked questions

Which regex flavor is this?

JavaScript (ECMAScript) — very close to Python and Java for common patterns.

Why is my pattern invalid?

Unescaped special characters like ( [ + are the usual suspects — the error message says which.

Is my test data uploaded?

No — 100% local.

How do I check if a string matches my pattern?

Paste the string as the test text. Matches highlight as you type and the counter shows how many were found — no highlight means no match.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/regex/" title="Regex Tester" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

First time embedding? Read the step-by-step guide →

More free tools