100% Free

Regex Tester

Enter a regular expression pattern and a test string to see all matches highlighted live, with capture groups and match count shown instantly.

/ /

Frequently Asked Questions

What is a regular expression?

A regular expression (regex) is a pattern of characters used to search, match, or manipulate text. For example, the pattern \d+ matches one or more digits, and [a-z]+ matches one or more lowercase letters. Regex is supported in virtually every programming language and is widely used for input validation, log parsing, and string manipulation.

How do regex flags work?

Flags modify how the matching engine behaves. The most common ones are: g (global) — find all matches instead of stopping at the first; i (case insensitive) — treat uppercase and lowercase as equal; m (multiline) — make ^ and $ match the start and end of each line rather than the whole string. Multiple flags can be combined.

What does the global flag do in regex?

Without the global flag, a regex stops after the very first match. With it enabled, the engine continues scanning and returns every matching substring. This matters when you need to count occurrences, replace all instances of a pattern, or extract every match from a long string — not just the first one encountered.