Skip to content
WoowTools

Regex Tester

Test regular expressions live: matches are highlighted as you type, with capture groups, match positions, all JavaScript flags and a library of common patterns.

Free Runs in your browser No sign-up

Loading Regex Tester…

Your files never leave your device

About this tool

This regex tester lets you build and debug regular expressions against your own text. Type a pattern and a test string, and every match is highlighted immediately, with its position and capture groups listed underneath. If the pattern is invalid, you see the error straight away. Patterns use JavaScript regular expression syntax, which is very close to what most other languages accept.

How to test a regex

  1. Enter your pattern, without the surrounding slashes.
  2. Switch on the flags you need.
  3. Paste or type the text to test.
  4. Read the highlighted matches and the match details: matched text, index and each capture group.
  5. Download the results if you want to keep them.

Regex flags explained

  • g (global): find all matches instead of stopping at the first.
  • i (case insensitive): A and a are treated the same.
  • m (multiline): ^ and $ match at the start and end of each line.
  • s (dot all): the dot also matches line breaks.
  • u (unicode): handles emoji and other characters beyond the basic range correctly.
  • y (sticky): match only at the exact position where the last match ended.

Quick syntax reference

PatternMeaning
\d \w \sA digit, a word character, a whitespace character
[abc] [^abc]Any of a, b or c; anything except a, b or c
a* a+ a?Zero or more, one or more, zero or one
a{2,4}Between 2 and 4 times
^ $Start and end of the string (or line with m)
(abc)Capture group
(?:abc)Group without capturing
a|ba or b

Common patterns

The built-in library includes ready patterns for tasks such as email addresses, URLs, phone numbers, dates and IP addresses. Load one, then adjust it to your exact rules. Remember that a regex checks the format, not whether an address or number really exists.

Debugging tips

  • Escape special characters such as . * + ? ( ) [ ] { } with a backslash when you mean them literally.
  • Greedy versus lazy: .* grabs as much as possible; .*? stops at the first chance.
  • Anchor your pattern with ^ and $ when the whole input must match.
  • Test edge cases: empty input, very long input and unusual characters.

Everything runs in your browser, so log files and private data stay on your device.

Frequently asked questions

Which regex flavor does this tester use?

JavaScript (ECMAScript) regular expressions, the same engine your browser uses. Most syntax is shared with Python, Java, PHP and .NET, but some advanced features differ.

Do I include the slashes around the pattern?

No. Type only the pattern, for example \d+, and switch flags on with the checkboxes instead of writing them after a slash.

How do I see capture groups?

Put part of the pattern in parentheses. The match details list each group's value for every match.

Why does my regex match too much?

Quantifiers like * and + are greedy by default. Add a question mark (*? or +?) to make them lazy, or use a more specific character class.

Why do I only get one match?

Turn on the g (global) flag to find all matches instead of only the first.

Is my test text sent anywhere?

No. Matching happens in your browser, so the text you test never leaves your device.