Test regular expressions in real-time. Matches are highlighted instantly.
Add this Regex Tester to your website or blog for free — just paste this code:
This regex tester lets you write a regular expression, run it against sample text and instantly see which parts match — no setup or installs required. It highlights matches and captured groups so you can debug a pattern before dropping it into your code. It is aimed at developers, data wranglers and anyone learning regular expressions in JavaScript, Python or similar languages.
You enter a pattern and optional flags, then paste the text you want to search. The tool compiles your expression using the browser's built-in JavaScript regular-expression engine and runs it against your input in real time, marking every match it finds. Because it uses the native engine, the behavior matches what you would see in JavaScript code.
Flags change how the pattern behaves: the global flag finds every match instead of just the first, and the case-insensitive flag ignores letter case. Captured groups — the parts of a pattern inside parentheses — are shown separately so you can confirm you are extracting exactly the right substrings.
\d{3}-\d{4} matches a phone fragment like 555-1234 by requiring three digits, a hyphen and four digits.
\b\w+@\w+\.\w+\b with the global flag against a paragraph pulls out every simple email address, such as hi@example.com, so you can verify the pattern before using it in code.
A regex (regular expression) is a sequence of characters that forms a search pattern. It is used to match, find or replace strings, and is supported by most programming languages and text editors.
This tester supports the g (global), i (case-insensitive), m (multiline), s (dotAll) and u (unicode) flags. You can combine them, for example gi to find every match regardless of case.
Yes — all processing happens in your browser and nothing is sent to a server. Your pattern and test text never leave your device, so you can safely test on sensitive data.
Common causes are forgetting the global flag when you expect multiple matches, using characters that need escaping such as a literal dot or bracket, or a pattern that is stricter than your text. Test with small inputs and add pieces of the pattern gradually to find the issue.