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

Binary, Octal, Decimal, Hex: How Number Bases Actually Work

By the Super Simple Digital Tools Team · Updated June 2026

Every number you have ever written is a positional number, meaning each digit's worth depends on where it sits. In decimal, the rightmost column counts ones, the next counts tens, then hundreds, each column being ten times the one to its right. Change that multiplier and you change the base. Binary multiplies by two per column, octal by eight, and hexadecimal by sixteen. Nothing magical separates these systems; they are simply four ways of grouping the same underlying quantity, and a base converter just rewrites that quantity in a different grouping.

Reading any base into a value follows one rule: multiply each digit by the base raised to its column position and add the results. Hex 2F means 2x16 plus 15x1, which is 47 in decimal (remember F stands for 15). The same rule decodes binary 101101 as 32 plus 8 plus 4 plus 1, or 45. Once you internalize this expansion, no base feels foreign, because the procedure is identical, only the base number you raise to a power changes.

Going the other direction, from a decimal value into another base, uses repeated division. Divide by the target base, keep the remainder, then divide the quotient again, and continue until the quotient hits zero. The remainders, read from last to first, spell out the answer. Converting 156 to hex, for instance, gives 156 divided by 16 as 9 remainder 12, and 12 is C, so the answer is 9C. It is the same loop whether your target is binary, octal, or hex.

The real shortcut lives between binary, octal, and hex, because their bases are all powers of two. One octal digit is exactly three bits and one hex digit is exactly four bits, so you can convert by regrouping rather than calculating. Take binary 11011010, slice it into nibbles 1101 and 1010, and you get D and A, so DA. This is precisely why programmers lean on hex: it is binary wearing a shorter, more readable costume, with each byte always landing as a tidy pair of hex digits.

Those relationships explain where each base earns its keep. Binary is the machine's native language of on and off. Hex shrinks long bit patterns into something a human can scan, which is why color codes, memory addresses, and hashes use it. Octal survives mainly in Unix permissions, where three-bit groups fall naturally into single digits. Decimal stays the language of people. A base converter is the bridge that lets you move a single value across all four worlds without losing a thing.

  • When converting binary to hex, group the bits into fours from the right and pad the leftmost group with leading zeros if it comes up short.
  • Sanity-check a hex-to-decimal result by remembering that two hex digits never exceed 255, the maximum value of one byte.
  • For octal file permissions, translate each digit to three bits: 7 is 111 (rwx), 5 is 101 (r-x), 0 is 000 (---).
  • If a field rejects your input, check the digit set: binary allows only 0 and 1, octal stops at 7, and hex tops out at F.

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