How to Use the Regex Tester
- Enter your regular expression pattern.
- Set flags such as g (global) or i (case-insensitive).
- Type or paste the text to test against.
- See matches highlighted and listed with their capture groups.
Why test a regular expression live
Regular expressions are powerful but easy to get subtly wrong. Testing against real sample text, and seeing matches and captured groups highlighted as you type, lets you refine the pattern quickly instead of guessing.
It is far faster than editing a pattern in your code and re-running the whole program each time.
Tips for reliable patterns
Anchor your pattern with ^ and $ when you mean the whole string, and remember to escape special characters like a dot or question mark when you want them literally. Watch greedy quantifiers, which match as much as possible; a lazy version (adding a ?) often does what you actually want.
Build the pattern up piece by piece and test each step. Your text and pattern stay in your browser, so nothing is sent anywhere.
Frequently Asked Questions
Which regex flavour does it use?
It uses JavaScript's built-in regular-expression engine, so patterns behave exactly as they would in JavaScript code.
Does it show capture groups?
Yes. For each match, the tool lists the full match and any captured groups, which helps when extracting parts of a string.
What do the flags mean?
g matches all occurrences, i ignores case, m treats each line separately for ^ and $, and s lets the dot match newlines.
