MikroBI Robot Logo

MikroBI | DevKit

manage_search

Regex Tester

Test regular expressions against real sample text and see every match highlighted, entirely in your browser.

Related tools

About this tool

Regular expressions are one of those tools that pay for themselves the first time you actually need one — validating an email or phone number format, pulling a version number out of a log line, finding every place a variable name appears before a rename, or cleaning up inconsistently formatted data pasted from somewhere else. The syntax is dense and easy to get subtly wrong, though, which is exactly why testing a pattern against real sample text before it ends up in production code (or a one-off script that runs against a whole dataset) is worth the extra minute.

This tool runs your pattern against your test string live, as you type, and shows you every match at once rather than making you guess. Matches are highlighted directly in the test string so you can see at a glance whether the pattern is greedy where it shouldn't be, missing edge cases, or matching more (or less) than you intended, and each match is also listed separately below with its exact position and any capture groups it produced.

The three flag toggles change how the underlying JavaScript regex engine behaves: case-insensitive (`i`) makes `A` and `a` equivalent, multiline (`m`) makes `^` and `$` match the start and end of each line rather than just the whole string, and dot-matches-newline (`s`) makes `.` match line breaks too, which it doesn't by default. Matching itself is always effectively global — every occurrence in the text is found, not just the first — since that's almost always what you want while testing a pattern, even if the `g` flag isn't something you'd normally think about explicitly.

Capture groups — the parenthesized parts of a pattern — let you pull specific pieces out of a match rather than just confirming the whole thing matched, which is exactly what you need when extracting a date, a username, or a query parameter from a larger string. This tool shows each match's captured groups alongside the full match so you can confirm the grouping is doing what you expect before wiring it into actual extraction code.

Everything happens using your browser's native, standards-compliant `RegExp` engine — the same one your JavaScript code will actually run against — so nothing you type is uploaded anywhere, and the tool keeps working with no internet connection once the page has loaded. Once you've got a set of matches you're happy with, use the “Send to” button to pass them straight into another tool in this toolbox, such as a formatter or a length counter.

Frequently asked questions

Why does the tool always match globally even if I don't check a "g" flag? expand_more

When you're testing a pattern, you almost always want to see every match in the text, not just the first one — so this tool always searches the full string. The i, m, and s toggles still change the matching behavior exactly as they would in your own code.

What's the difference between the multiline (m) and dot-matches-newline (s) flags? expand_more

Multiline (m) changes what ^ and $ anchor to — the start/end of each line instead of the whole string. Dot-matches-newline (s) changes what . can match — normally it matches any character except a line break, and s makes it match line breaks too. They're independent and often confused.

Why is my pattern reported as invalid? expand_more

The tool constructs a real JavaScript RegExp from your pattern and flags, so it reports the exact same syntax error your own code would hit — commonly an unclosed group, an unescaped special character, or an invalid flag combination.

Does this tool support named capture groups? expand_more

Yes. Named capture groups — for example, naming a group "year" instead of leaving it positional — are recognized, and their values are matched alongside the positional groups.

Is my test text sent anywhere? expand_more

No. Matching runs entirely in your browser using its built-in regular expression engine — nothing is uploaded to a server, and the tool keeps working offline once the page has loaded.