🔍

Regex Tester

Test & highlight regex matches live

Regular Expression
//
Test String
Enter a pattern and test string above
Highlighted Matches

About Regex Tester

Write the pattern, paste your test string, see what it matches in real time. No need to run a script just to check if a regex works. Supports all standard JavaScript flags: `g` for global (find all matches, not just the first), `i` for case-insensitive, `m` for multiline (makes ^ and $ match line boundaries), and `s` for dotAll. Match count updates as you type. Useful when validating email patterns, writing log parsers, debugging find-and-replace operations, or just trying to understand a regex someone else wrote.

Common Use Cases

  • Testing email, phone number, or postcode validation patterns
  • Extracting structured data from log lines
  • Debugging a regex before putting it in production code
  • Understanding what a complex pattern actually matches

Frequently Asked Questions

Which regex flavour does this use?+
JavaScript's built-in RegExp engine (ECMAScript standard). Most patterns transfer directly to other languages, though some advanced features like lookbehinds or named groups may behave differently in older engines.
What do the flags g, i, m do?+
g (global) finds every match instead of stopping at the first. i (case-insensitive) treats upper and lowercase as equivalent. m (multiline) makes ^ and $ match the start and end of each line, not just the entire string.
Why does my pattern match too much?+
Probably a greedy quantifier. By default, * and + grab as much as they can. Add ? after them (e.g. .*?) to switch to lazy matching, which stops at the earliest possible point.
How do I match a literal dot or parenthesis?+
Escape it with a backslash: \. matches a literal dot, \( matches a literal opening parenthesis. Without the backslash, . matches any character and ( starts a capturing group.