Regex Tester
Test regular expressions against any string with live match highlighting, flag toggles, and a numbered match list.
How to use
- Enter a regular expression pattern in the pattern field.
- Toggle flags (g, i, m) and type or paste your test string below.
- Matches are highlighted in real time with a numbered list of each match and its position.
Frequently asked questions
What is a regular expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used for string matching, searching, and text manipulation in programming languages, text editors, and command-line tools.
What do regex flags do?
Flags modify how the regex engine processes the pattern. g (global) finds all matches instead of stopping at the first. i (case insensitive) ignores letter case. m (multiline) makes ^ and $ match line boundaries instead of just string boundaries.
How do I match a whole word?
Use word boundary anchors: \bword\b matches "word" only when it appears as a complete word, not as part of another word like "password" or "wording".
What's the difference between greedy and lazy matching?
Greedy quantifiers (*, +, {n,m}) match as much text as possible. Lazy quantifiers (*?, +?, {n,m}?) match as little as possible. For example, on "<b>one</b><b>two</b>", the greedy pattern <b>.*</b> matches the entire string, while <b>.*?</b> matches only "<b>one</b>".