Regex Tester

Test regular expressions against sample text with live match highlighting and global, case-insensitive, and multiline flags.

Presets:
//gm
Test String
Match Preview0 Matches

Match Info

No matches found yet.

Cheat Sheet

.
Any Character
\d
Digit
\w
Word Char
\s
Whitespace
^
Start of Line
$
End of Line
[\w._%+-]+@[\w.-]+\.[a-zA-Z]{2,}
Email

About Regex Tester

The Regex Tester lets you write a regular expression and see exactly what it matches in sample text, instantly. Matches are highlighted in the Match Preview, capture groups are listed under Match Info, and you can toggle the global, case-insensitive and multiline flags with a click.

It includes preset patterns for common tasks such as email addresses, phone numbers, hashtags, ISO dates and passwords, and a cheat sheet of tokens (any character, digit, word character, whitespace, start and end of line) so you can build patterns without leaving the page.

How to use the Regex Tester

  1. Type your pattern into the Regex Pattern box, or choose a preset to start from.
  2. Choose flags: Global (g), Insensitive (i) and Multiline (m).
  3. Paste or type the text you want to test in the Test String area.
  4. Review the highlighted matches in Match Preview and the groups in Match Info.
  5. Adjust the pattern until it matches exactly what you intend.

What it can do

Live highlighting

Matches update as you type, so mistakes show up immediately.

Capture groups

Inspect each group of every match to verify extraction patterns.

Flag toggles

Switch global, case-insensitive and multiline behaviour on and off.

Presets and cheat sheet

Start from common patterns and look up tokens without searching the web.

When it is useful

  • Building and debugging an input validation pattern for a form.
  • Extracting dates, IDs or emails from log files or text.
  • Preparing a find-and-replace expression for an editor.
  • Learning how regular expressions work by experimenting.

Good to know

  • The tester uses JavaScript regular expression syntax. Patterns for other languages (PCRE, Python, .NET) can differ in features such as lookbehind, named groups or possessive quantifiers.
  • Email and password presets are practical starting points, not complete validators. Real validation rules vary by system.
  • Very complex patterns with nested quantifiers can run slowly (catastrophic backtracking). Test with realistic input sizes.

Frequently Asked Questions

Q.Which regex flavour does the tester use?
JavaScript (ECMAScript) regular expressions, as implemented in your browser.
Q.What do the g, i and m flags do?
g finds all matches instead of just the first. i ignores letter case. m makes ^ and $ match at the start and end of each line rather than the whole string.
Q.How do I see my capture groups?
Wrap part of your pattern in parentheses. The Match Info panel lists each match and the contents of its groups.
Q.Why does my pattern work here but not in Python or PHP?
Regex syntax differs a little between languages. Lookbehind, named group syntax and flags in particular vary, so verify against your language’s documentation.
Q.Is my test text uploaded?
No. Everything runs in your browser.
Q.What is the pattern \d+ ?
\d matches one digit and + means one or more, so \d+ matches whole numbers such as 7 or 2026.
Q.Can I trust the email preset to validate emails?
It catches typical formats but cannot guarantee an address exists or conforms to every rule in the email standards. Use it as a first check.

User Reviews

Write a Review

0/500 characters (minimum 10)