MaisTools
Developer/

Regex Tester

Test JavaScript regular expressions with live highlighting and capture groups.

Pattern

Flags

Test text
Highlighted matches
Enter a pattern and some text to see matches
Matches
No matches yet

About this tool

Tests JavaScript regular expressions with live match highlighting and capture groups. Useful for building and debugging regex without an interpreter, validating patterns before pasting them into code, figuring out why a regex that should work isn't matching what you expect, and learning by experimentation.

How to use

  1. Write your regex pattern.
  2. Set the flags (g for all occurrences, i for case insensitive, m for multiline, etc.).
  3. Paste the text to test.
  4. See matches highlighted in the text and capture groups listed.

Frequently asked questions

Which regex flavor is used?
JavaScript (ECMAScript). Most patterns also work in other languages (Python, Ruby, PCRE), but there are differences in more advanced syntax: lookbehind, named groups, Unicode properties. For regex you'll use in another language, check the specific differences.
What are capture groups?
Parts of the regex inside parentheses that capture what they match, for reuse. For example, the pattern (\w+)@(\w+) applied to "ana@mail.com" captures "ana" in group 1 and "mail" in group 2. Useful for extracting specific parts of a text.
What are the g, i, m, and s flags for?
g (global) makes the regex match all occurrences, not just the first. i (case insensitive) ignores upper/lower case. m (multiline) makes ^ and $ match the start and end of each line instead of just the whole text. s (dotall) makes the dot . also match newlines.