Regex Tester
Test and debug regular expressions in real time. See matches highlighted instantly, inspect capture groups, and test replacements.
Enter a pattern to see results.
What Is a Regular Expression?
A regular expression (regex) is a sequence of characters that defines a search pattern. Regular expressions are used in programming, text editors, and command-line tools to find, match, and manipulate text. They are supported in virtually every programming language including JavaScript, Python, Java, Go, Ruby, and PHP.
How to Use This Regex Tester
Enter your regular expression pattern in the pattern field at the top. Toggle flags like global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u) using the checkboxes. Type or paste your test string in the textarea below. Matches are highlighted in real time as you type. The results panel shows each match with its index position and any captured groups. Use the replace field to test substitutions.
Common Regex Patterns
Some frequently used patterns include email validation ([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}), URL matching, phone number extraction, IP address validation, and date format detection. This tool includes a quick-select menu with these common patterns so you can start testing immediately without writing the regex from scratch.
Regex Flags Explained
- g (global) — Find all matches, not just the first one.
- i (case-insensitive) — Match letters regardless of case.
- m (multiline) — Make ^ and $ match the start and end of each line.
- s (dotAll) — Make the dot (.) match newline characters as well.
- u (unicode) — Enable full Unicode matching.