Developer Tools

Regex Tester

Flags
Highlighted text

A regular expression (regex) is a pattern used to search, validate, or split text — from a simple word to complex validation of email addresses, dates, or postal codes. This tool uses your browser's built-in RegExp engine (ECMAScript/JavaScript syntax), the exact same engine behind every JavaScript validation in web forms. Type a pattern, pick the flags you need, and paste your test text: matches and capture groups update live as you type, and are highlighted right in the text. Everything happens entirely client-side in your browser — nothing is sent to our server and nothing is stored. An invalid pattern (say, an unclosed bracket) produces a clear error message, never a crashed page.

What people use this for

  • \b[\w.%+-]+@[\w.-]+\.[A-Za-z]{2,}\b — matches [email protected] in email validation
  • ^\d{4}-\d{2}-\d{2}$ — matches 2026-08-05 (ISO date format)
  • (\d{2})-(\d{2})-(\d{4}) — matches 05-08-2026, with group 1 = 05, group 2 = 08, group 3 = 2026
  • \bhttps?://\S+\b — matches https://westcube.nl in free text

What others think of this tool

No reviews for this tool yet. Yours would be the first.

Frequently asked questions

Which regex syntax does this tool use?

This tool uses the RegExp engine built into every browser: ECMAScript/JavaScript syntax. That's largely compatible with PCRE (Perl-style regex like PHP, Python's re module, or grep -P), but there are differences — JavaScript, for instance, didn't support lookbehind before ES2018 and uses slightly different named-group syntax ((?<name>...) instead of Python's (?P<name>...)). Always test your pattern in the environment it will actually run in; this tool is representative of any JavaScript validation in a browser form or Node.js backend.

What do the g, i, m, s, and u flags mean?

g (global) finds all matches in the text instead of only the first one. i (ignore case) makes matching case-insensitive. m (multiline) makes ^ and $ match the start/end of each line instead of only the start/end of the whole text. s (dotAll) makes the dot (.) also match a newline, which it normally doesn't. u (unicode) treats the pattern as a sequence of Unicode code points instead of individual UTF-16 units, which matters for emoji or characters outside the basic Latin alphabet.

Why do I get an error message instead of results?

A regular expression has to be syntactically valid: parentheses and brackets need to balance, a quantifier (*, +, ?, {n,m}) needs something to apply to, and a backreference must point to a group that actually exists. This tool builds your pattern with JavaScript's own RegExp constructor, so any error the browser itself would raise (for example 'Invalid regular expression: Unterminated group') is shown directly and legibly instead of the page freezing or silently returning nothing.

What is a capture group and where do I see it here?

A capture group is a part of your pattern wrapped in parentheses, for example (\d{4}) in ^(\d{4})-(\d{2})-(\d{2})$. On a match, this tool shows not just the full match but also every numbered group individually (group 1, group 2, ...), and, if you use named groups like (?<year>\d{4}), the name alongside it. Useful for confirming you're extracting exactly the right part of the text before you use the pattern in your own code.

Is my pattern and test text stored anywhere?

No. All matching happens locally in your browser using JavaScript's own RegExp object. Nothing is sent to any Westcube server (or anyone else's), nothing is logged, and nothing is retained. Close the tab and everything is gone — safe to use even with sensitive sample data (like example email addresses) when testing your pattern.