Regex Tester

Test regular expressions with live matching and highlights.

What is Regex Tester?

Regex Tester lets you write regular expressions and instantly see matches highlighted against your test text. Shows match positions, capture groups, and match count. Supports all JavaScript regex flags.

How to use this tool

  1. Enter your regex pattern on the first line (e.g., /pattern/gi).
  2. Enter your test text on the following lines.
  3. See all matches listed in a table with position and capture groups.
  4. Adjust your pattern and see results update instantly.
  5. Use flags: g (global), i (case-insensitive), m (multiline), s (dotall).

Frequently asked questions

What is a regular expression?
A pattern that describes a set of strings. Used for searching, matching, and replacing text. For example, \d{3}-\d{4} matches phone numbers like 555-1234.
What does the g flag do?
Global flag — finds all matches instead of stopping at the first one. Without g, only the first match is returned. Always use g when you want to find every occurrence.
How do capture groups work?
Parentheses create capture groups that extract parts of a match. In (\d{3})-(\d{4}), group 1 captures the area code and group 2 captures the number. Access them with $1, $2 in replacements.
Why is my regex slow?
Catastrophic backtracking — patterns like (a+)+ or (.*a)* can take exponential time on certain inputs. Avoid nested quantifiers and use atomic groups or possessive quantifiers when possible.

Related tools

Need a place to build your project?

Launch a cloud workspace with Claude Code. Your AI builds it, we host it.

Start for $5/month