Regex Tester

Test regular expressions live with match highlighting and capture groups. Free, in your browser.

2 matches
Contact ada@example.com or grace@test.org for details.

Live regex testing in your browser using JavaScript's regular-expression engine.

Free to use — premium coming soon

FREE
  • Live highlighting
  • Capture groups
  • 100% private
PREMIUM
  • Remove ads
  • Save patterns & cheat sheet

About the Regex Tester

The Regex Tester lets you write a regular expression, drop in some sample text, and instantly see exactly what your pattern matches. Every match is highlighted in place, so you can confirm a pattern catches what you expect before pasting it into your code. It is built for the everyday jobs developers throw at regex: pulling timestamps and error codes out of log files, validating the shape of phone numbers or postal codes, finding-and-replacing across a block of text, or extracting fields like dates and IDs from messy strings. Instead of guessing and re-running your program, you iterate on the pattern here and watch the highlighting update.

Use it whenever a pattern is not behaving the way you assumed. A classic example is forgetting to escape the dot: the pattern .com looks like it matches ".com" but actually matches any character followed by "com", so it happily matches "xcom" too. The tester makes that mistake obvious because the highlight lands somewhere you did not intend. The same goes for greedy quantifiers like .* swallowing more than you want, missing anchors so /test/ matches "testing", or character-class slips like [a-Z]. Seeing the live match turns abstract debugging into something you can spot at a glance.

Under the hood it runs the standard JavaScript regular-expression engine, the same one in every modern browser, and exposes the flags you toggle on the pattern. g (global) returns every match rather than just the first; i ignores case; m makes ^ and $ match the start and end of each line instead of the whole string; s lets the dot match newlines; u enables full Unicode matching; and y (sticky) anchors matching to a fixed position. Capture groups, written with parentheses, are broken out per match so you can verify Group 1, Group 2, and named groups like (?<year>\d{4}) are capturing the right substrings.

Everything runs entirely in your browser. Your pattern and your test text are never uploaded to a server, which matters when you are testing against real log lines, user records, or anything sensitive. One honest caveat: results reflect JavaScript's regex dialect. If your real code runs in Python, PCRE, Java, or .NET, most syntax carries over, but a few features (lookbehind support, named-group syntax, inline flags, and Unicode property escapes) differ between engines. Treat a green match here as strong evidence, then confirm anything exotic in your target language.

Frequently asked questions

What do the regex flags g, i, m, s, u, and y actually do?

g (global) finds every match instead of stopping at the first; i makes matching case-insensitive; m makes ^ and $ match the start and end of each line; s lets the dot match newline characters; u turns on full Unicode matching; and y (sticky) forces the match to start exactly where the previous one ended. You can combine them, for example gi to find all matches regardless of case.

What is a capture group and how do I read the results?

A capture group is any part of your pattern wrapped in parentheses, and it extracts that piece of each match separately. Group 1 is the first set of parentheses, Group 2 the second, and so on. You can also name a group with (?<name>...) for readability, and reference groups as $1, $2, or $<name> in replacement strings.

Why isn't my pattern matching what I expect?

The most common reasons are an unescaped special character (write \. for a literal dot, since . matches any character), a greedy quantifier like .* grabbing too much (try the lazy form .*?), or missing anchors (use ^pattern$ when you need an exact full match). The live highlighting usually shows you immediately where the pattern is landing instead.

Is my pattern and test text sent to a server?

No. The tester runs in your browser using the built-in JavaScript regex engine, so your pattern and sample text never leave your device. That makes it safe to test against real log files, records, or other sensitive data.

Will a pattern that works here work in Python or another language?

Usually, because core regex syntax is shared across engines, but not always. This tool uses JavaScript's dialect, and features like lookbehind, inline flag modifiers, named-group syntax, and Unicode property escapes can differ in Python (re), PCRE, Java, or .NET. Verify anything advanced in your target language.

From our blog

Minify, Then Compress: How to Actually Make Your CSS Smaller

By the Super Simple Digital Tools Team · Updated June 2026

Most advice about shrinking CSS treats 'minify' and 'compress' as the same task, but they solve different problems. Minification is a syntactic cleanup: it deletes the characters a browser ignores anyway, like comments, indentation, and the optional semicolon before a closing brace. Compression, the gzip or Brotli step your web server performs, is a byte-level algorithm that spots repeated strings and replaces them with short back-references. One reshapes the text; the other re-encodes it. Understanding the split is the key to not over- or under-optimizing your stylesheets.

The numbers tell the story. On a typical framework stylesheet, minification alone removes only a modest share of the bytes, because comments and whitespace are a small fraction of a dense CSS file. Gzip, by contrast, can cut the same file dramatically since CSS is full of repeated property names and values. So if you could only pick one, gzip wins by a wide margin. The catch is that you do not have to pick. Doing both yields a file smaller than gzip alone, and minification also trims the time the browser spends parsing, since it no longer steps over comments and formatting.

The practical workflow is to put minification in your build and leave compression to the server. Keep your readable, commented source in version control, and generate the minified file as an output you never edit by hand. For a quick one-off, a paste-in browser tool like this one is perfect: drop in the CSS, copy the minified result, and ship it. For an ongoing project, wire a minifier into your bundler or a PostCSS step so every deploy produces optimized CSS automatically without manual effort.

Compression is usually already on, but it is worth confirming. Check your responses for a Content-Encoding header of gzip or br; most CDNs and modern servers enable it by default for text assets including CSS. If it is missing, turning it on will do more for your file sizes than any amount of minifying. Once both are in place, the remaining wins come from sending less CSS in the first place, such as removing unused rules and splitting out critical styles, rather than squeezing the formatting harder.

Finally, plan for debugging before you minify. Minified CSS is unreadable, so when something breaks in production you want a source map, a separate file that maps each minified position back to your original line and column so DevTools can show the code you actually wrote. Build tools generate these automatically; a simple paste-and-minify utility does not. Many teams ship external or hidden source maps to production because the map only loads when DevTools is open, so it costs visitors nothing while making live issues far easier to trace.

  • Always keep your original, commented CSS in version control and treat the minified file as a regenerated build artifact, never as something you edit directly.
  • Confirm your server sends Content-Encoding: gzip or br for CSS; compression saves far more bytes than minification, and both together beat either alone.
  • Watch whitespace-sensitive values such as content: " " in pseudo-elements, and diff the rendered page, not just the file size, before deploying minified output.
  • For ongoing projects, run minification through a bundler or PostCSS so it happens on every build and can emit source maps for debugging.

Read the full guide →

Tool by the Super Simple Digital Tools Team. Reviewed by our editorial team. Free to use, no signup required.

Related tools