🛠️Dev Toolbox

🔍 Regex Tester

Test and debug regular expressions against your text with live matching, explanation of each pattern component, and support for all major regex flags.

//
Matches: 0

Every developer has a regular expression war story. For me it was a one-liner that was supposed to validate email addresses and instead took 45 seconds to fail catastrophically on a 50KB input string, because someone nested two greedy quantifiers in a way that produced exponential backtracking. The regex itself was 23 characters. The bug took two days to trace. If you've ever stared at a regex that "works in testers but fails in prod" or thrown up your hands and rewritten a pattern from scratch because you couldn't explain why it matched something you didn't want — this is the tool for that experience.

A regex is a tiny declarative language for describing a text pattern. You don't write an algorithm that searches; you write a description of what you're looking for and let the engine figure out how. That inversion of control is powerful and occasionally infuriating. The language is dense — a single \b or (?= or {2,} packs meaning that takes experience to parse at a glance. Beginners write regexes pasted from Stack Overflow and praying they work. Veterans write them out calmly, explain them in comments, and test them on adversarial inputs before shipping.

This tester gives you a place to write and break regexes live without touching your codebase. Type a pattern in the main field and the tool highlights every match in your sample input as you type — not on "submit," not on page refresh, on every keystroke. Color coding shows which portions correspond to which capture groups. A sidebar panel walks through your pattern token by token (\d = any digit, (?:...) = non-capturing group, (?=...) = lookahead) and explains each one in plain English. If your pattern has a syntax error, the error line lights up and points to the exact position instead of failing silently.

Flag toggles cover the six most common modifiers: global /g (find all matches vs. just the first), case-insensitive /i, multiline /m (makes ^ and $ match at line boundaries), dotAll /s (makes . match newlines), unicode /u (enables \p{L} escapes), and sticky /y (match only from lastIndex onward). Toggling them updates the highlights instantly — you see at a glance which results are flag-dependent and which aren't, something that's maddeningly hard to see in a static editor.

The replace mode lets you type a replacement string with capture-group references ($1, ${name} for named groups) and previews the result live. The preset library covers the patterns people reach for most often: email, URL, IPv4, US phone, hex color, ISO date, slug — with the caveat clearly stated that "email regex" is a case where the technically correct pattern is a 6000-character monster, and the practical one is /@/ (does it contain an at-sign?) plus send a confirmation email. The tool chooses honesty over overpromising.

Engine notes worth knowing. Under the hood this tester uses JavaScript's regex engine (the same one V8 ships in Chrome and Node), so the behavior you see is the behavior you'll ship to browsers and Node backends. Python, Java, .NET, and Perl each have their own extensions beyond ECMAScript — possessive quantifiers, atomic groups, branch reset, callouts — so a pattern that works here may need translation. The tool flags constructs that aren't portable so you don't learn that the hard way during your first migration.

Real workflows it fits into: validating a pattern before wiring it into a form validator, reproducing a production bug with the exact input that tripped it, teaching a junior developer how regex works by letting them click through a step-by-step trace, converting a glob pattern or a string of SQL LIKE syntax into an equivalent regex, sharing a pattern with a teammate via a URL that encodes the pattern, flags, and test input, and documenting the intent of each group in a pattern via the (?<name>...) named capture syntax.

More Developer Tools

Explore our complete collection of 60+ free developer tools at dev.aisoosoo.com. All tools run 100% in your browser — no signup, no data sent to servers.