Regex Tester
Regex Tester runs your pattern against any text and highlights every match in place, so you can see exactly what a regular expression captures. It surfaces the match count, each capture group and the index of every hit as you type.
It uses the same regular-expression engine as the browser, so behaviour matches real JavaScript. Everything runs locally — your patterns and test data never leave the page.
Highlighted matches
Contact us at hello@example.com or support@multitool.dev. Invalid: foo@bar and plain text without an address. Another one: admin@site.io works too.
Match list
hello@example.comindex 14support@multitool.devindex 35admin@site.ioindex 123Tip: matches are always collected globally so every occurrence is highlighted. Toggle the g flag to see it reflected in the pattern label above.
How to use Regex Tester
- 1
Enter your pattern
Type a regular expression in the pattern box. You don't need the surrounding slashes — just the expression itself.
- 2
Choose flags
Toggle the g, i, m, s, u and y flags. Matches are always collected globally for highlighting, and the active flags appear next to your pattern.
- 3
Read the results
Paste your test string to see matches highlighted, the total match count, and a breakdown of each capture group with its index.
What is a regular expression?
A regular expression — or regex — is a compact pattern language for describing text. Instead of searching for a fixed word, you describe a shape: "a digit followed by two letters", "anything between quotes", or "a valid email address". Engines then scan your text and return every span that fits the shape.
Regular expressions power find-and-replace in editors, input validation in forms, log parsing, and search across millions of files. Because the syntax is dense, a tester that shows matches and groups in real time is the fastest way to get a pattern right without trial-and-error in code.
Understanding flags and capture groups
Flags change how a pattern is applied. The global flag (g) finds every match rather than stopping at the first; ignore-case (i) makes letters case-insensitive; multiline (m) lets ^ and $ match the start and end of each line; dotall (s) lets the dot match newlines; unicode (u) enables full Unicode handling; and sticky (y) anchors each match to the position where the last one ended.
Capture groups — the parts of your pattern wrapped in parentheses — pull out sub-sections of each match. This tester lists every group by number ($1, $2, …) and shows named groups too, so you can confirm a pattern extracts exactly the fields you expect before wiring it into code.
Frequently asked questions
- Which regex syntax does this use?
- It uses the JavaScript (ECMAScript) regular-expression engine built into your browser, so any pattern that works here works the same way in JavaScript and TypeScript.
- Why are matches highlighted even without the global flag?
- To highlight every occurrence, the tester always iterates globally internally. The flags you toggle are still shown beside the pattern so you can copy the exact expression you intend to use.
- Does it support capture groups?
- Yes. Each match lists its numbered capture groups and any named groups, along with the match's index in the test string.
- Is my data sent anywhere?
- No. Matching runs entirely in your browser; your pattern and test text never leave the page.
Last updated: