Regex Tester

Test regular expressions with real-time matching and capture groups. Everything runs in your browser — your data stays private.

How to Test Regular Expressions Online

Regular expressions are one of the most powerful tools in a developer's toolkit for pattern matching and text manipulation. This free regex tester lets you write a pattern, set flags, and instantly see all matches highlighted against your test string — complete with capture group details and match positions.

Features

The tester supports all JavaScript regex flags including global, multiline, case-insensitive, and dotAll. Each match displays its position in the string and any captured groups, making it easy to debug complex patterns before using them in your code.

Frequently Asked Questions

What is a regular expression?

A regular expression (regex) is a sequence of characters that defines a search pattern. It's used for string matching, validation, and text manipulation in programming languages like JavaScript, Python, and Java.

What are common regex flags?

Common flags include g (global — find all matches), m (multiline — ^ and $ match line boundaries), i (case-insensitive matching), and s (dotAll — dot matches newlines).

How do capture groups work?

Capture groups use parentheses () to extract specific parts of a match. For example, the pattern (\d+)-(\d+) applied to "123-456" would capture "123" and "456" as separate groups.