How to use Regex Tester
- Write your patternEnter the expression in the Pattern field without delimiters or trailing flags, for example [a-z]+@[a-z]+
- Add test textPaste the text you want to search into the Test text field.
- Run and review matchesPress Run Regex Tester to list each match with its capture groups, up to 50 matches, or to see the error if the pattern is invalid.
Common uses
- Checking a validation pattern before adding it to PHP or Laravel code
- Extracting emails, IDs or dates from a pasted log excerpt
- Debugging why a preg_match call finds nothing
Frequently asked questions
How do I use Regex Tester?
1. Write your pattern: Enter the expression in the Pattern field without delimiters or trailing flags, for example [a-z]+@[a-z]+ 2. Add test text: Paste the text you want to search into the Test text field. 3. Run and review matches: Press Run Regex Tester to list each match with its capture groups, up to 50 matches, or to see the error if the pattern is invalid.
Which regex flavour is used?
PHP’s PCRE engine via preg_match_all, with the u (Unicode) modifier always on. Results match what PHP code would find, which can differ from JavaScript, Python or .NET for some syntax and features.
How do I set flags such as case-insensitive?
Tick the boxes under Test text: Ignore case (i), ^ and $ match at line breaks (m), Dot matches line breaks (s) and Ignore whitespace in the pattern (x). Inline modifiers such as (?i) at the start of the pattern work too, and u (Unicode) is always on.
Are capture groups shown?
Yes. Below each match, every capture group is listed as $1, $2 and so on, or by its name for named groups such as (?<year>\d{4}). A group that took no part in the match shows —.
Is my text processed on a server?
Yes. The pattern and test text are sent to the GigaTools server, matched with PHP and returned; the tool does not store them. Remove personal data and secrets from log excerpts first.