Skip to content

Regex Tester

Test and debug regular expressions with live highlighting

Get your regex right before it hits production

Regex is one of those things where you’re either 100% confident in your pattern or you have no idea if it’ll match what you think it will. There’s rarely an in-between.

Type your pattern, paste your test string, and matches light up immediately. You see how many matches there are, their exact positions, and every captured group. Toggle flags on and off, global, case-insensitive, multiline, dotAll, unicode, and watch the results change in real time.

Way faster than editing your code, running it, checking the output, tweaking, running again. Just iterate in the browser until the pattern works.

The flags, quickly

g (global): find all matches, not just the first. i (case-insensitive): /hello/i matches “Hello”, “HELLO”, “hello”. m (multiline): ^ and $ match start/end of each line, not just the whole string. s (dotAll): . matches newlines too. Without this, . matches everything except \n. u (unicode): proper handling of characters outside the BMP (emojis, etc.).

Each flag has its own toggle button. Combine them however you need.

Patterns you’ll keep coming back for

Email: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ URL: https?:\/\/[^\s]+ IP address: \b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b Date (YYYY-MM-DD): \d{4}-\d{2}-\d{2} HTML tags: <[^>]+> Hex colors: #[0-9a-fA-F]{3,8}

Paste any of these into the pattern field and test them against your data.

Captured groups

The match details table shows every captured group with its value and group number. If your pattern has (parenthesized) sub-expressions, you’ll see exactly what each group matched. Essential for debugging complex patterns with multiple captures.

One thing to keep in mind

This uses the browser’s native JavaScript RegExp engine. Patterns that work here will work in any JavaScript environment. But Python, Java, PCRE, and other regex flavors have slightly different features and syntax, named groups, lookbehinds, and possessive quantifiers may behave differently across engines.

FAQ

Which regex engine?

JavaScript’s native RegExp, the browser’s built-in engine. Compatible with Node.js and all browser JavaScript.

Does it show capture groups?

Yes, every captured group for each match, with values and group numbers.

Multiline testing?

Enable the m flag and ^/$ will match at line boundaries within your test string.

Privacy?

All client-side, your patterns and test data stay in your browser.

regex tester regular-expression pattern developer

Related Tools

More in Developer Tools