UK’s trusted IT infrastructure partner since 2003
Servnet
ToolsConfiguratorGet in Touch

Regex tester

Test regular expressions live — with flags, highlighted matches, capture groups and a match map across your test string.

inout././\d+/g[a-z]+match
//gi
Highlighted
Contact sales@servnetuk.com or support@servnetuk.com for a quote. Serving the UK since 2001 — call 0800 0584 944.
Matches2
sales@servnetuk.com@ 8
support@servnetuk.com@ 31
Matches across the test string2 matchesstartend · 113 chars

Patterns are evaluated with the native JavaScript regex engine, in your browser. Capture groups are listed under each match; the bar above shows where matches fall across the test string.

JSON FormatterBase64URL EncoderCron GeneratorAll developer tools

How to test a regular expression

Type your pattern between the slashes and toggle the flags you need. Enter or paste a test string below; matches are highlighted in place, listed individually with their position and capture groups, and plotted on a map so you can see where they fall. Everything updates as you type, so you can refine a tricky pattern in seconds.

From validation to extraction

Regular expressions are the Swiss-army knife of text: validating form fields, parsing log lines, scraping identifiers, and powering find-and-replace. They are also easy to get subtly wrong, which is why an interactive tester with live highlighting and group inspection saves so much time over guessing in code.

🔐 Local only: your pattern and data stay in the browser. For software, automation and integration work, Servnet is a UK IT partner since 2001.

Regex — common questions

Which regex flavour does this use?

It uses the JavaScript (ECMAScript) regular-expression engine built into your browser — the same one your front-end code runs. Supported flags are g (global), i (ignore case), m (multiline), s (dotall) and u (unicode).

How do I see capture groups?

Each match in the list shows its captured groups numbered 1, 2, 3… Add parentheses ( ) to your pattern to create groups; an empty group is shown as ∅. This is ideal for extracting parts of a string, like the domain from an email.

What do the flags do?

g finds all matches rather than just the first; i makes the pattern case-insensitive; m makes ^ and $ match at line breaks; s lets . match newlines; u enables full Unicode handling. Toggle them and watch the matches update live.

Why is the match count capped?

To keep the page responsive, matching stops after a safety limit (shown with a “+”). Patterns that can match an empty string (like a*) are advanced automatically so they cannot loop forever.

What can I use regex for?

Validating input (emails, postcodes, IDs), searching and extracting data from logs, find-and-replace across code, and parsing structured text. Testing interactively here is far faster than trial-and-error in code.

Is my test data private?

Yes. The pattern and test string never leave your browser — matching runs locally in JavaScript.