Skip to content
Allin

Regex tester

Test a regular expression and see what it does: matches highlighted in the text, every capture group listed, a replace panel, and the pattern read back to you piece by piece. Flags are toggles that say what they change, and a pattern that could freeze the page is flagged before you run it.

This free regex tester lets you build and debug regular expressions live. Type a pattern, paste your test text, and see every match highlighted in real time — with flags for global, case-insensitive and multiline matching. It's the fastest way to check a regex before dropping it into your code.

How to use it

  1. Type your regular expression pattern.
  2. Paste the text you want to test it against.
  3. Review the highlighted matches and adjust flags.

Frequently asked questions

What is a regular expression?

A regular expression (regex) is a compact pattern for matching text — used to search, validate and extract strings like emails, phone numbers or dates.

What do the g, i and m flags mean?

g (global) finds all matches instead of stopping at the first, i (insensitive) ignores letter case, and m (multiline) makes ^ and $ match at each line break.

How do I match an email or a number?

Use character classes: \d+ matches one or more digits, and a simple email pattern is \S+@\S+\.\S+. Test and refine it here until it fits your data.

What does Regex tester do?

Test a regular expression and see what it does: matches highlighted in the text, every capture group listed, a replace panel, and the pattern read back to you piece by piece. Flags are toggles that say what they change, and a pattern that could freeze the page is flagged before you run it.

What does it take into account?

It factors in matches highlighted in the text, every capture group listed, a replace panel, and the pattern read back to you piece by piece. Flags are toggles that say what they change, and a pattern that could freeze the page is flagged before you run it. Change any of them and the output follows immediately.

When would I actually use this?

Getting usable data out of something that was never meant to be parsed: pulling every address out of a pasted thread, turning a column of lines into a JSON array or an SQL IN clause, renaming a hundred identifiers from snake_case to camelCase in one pass.

What is the most common mistake?

Trusting an extraction to be exhaustive. A pattern that catches every address in the sample will still miss the one wrapped across a line break, the one written with a display name, and the one an email client turned into a link — count what came out against what you expected before you use the list.

What else is filed next to it?

ASCII code converter, Number base converter and Programming case converter share its section. They are not variants of it — being filed together is not the same as being alike — but that is where to look if this turned out not to be the tool you wanted.

Where do the figures come from?

Extraction runs on patterns, not on a parser: it recognises the common shapes of an address, a URL or an IP rather than validating them against their specification. That is the right trade for a paste, and the wrong one for input you are about to store.

Further reading

All guides
How-toRegex Basics: A Beginner's GuideA regular expression is a pattern for matching text. Here are the building blocks — character classes, quantifiers and anchors — with a worked example.ComparisonJSON vs XML: What's the Difference?JSON and XML both store structured data as text, but they trade off differently. Here's how each looks, where each wins, and how to choose.GuideFind and Replace: The Regex Features That Bite, Demonstrated One by OneGreedy against lazy on the same string, the dot that skips newlines, $& and $$ in the replacement, a reused /g regex that silently skips a row, and why /i knows nothing about Turkish i. Every failure run in Node, with a count-then-replace routine that catches them.ExplainerSemicolon, Tab, Pipe: Choosing a Delimiter That Survives the TripWhy the reader's language decides the delimiter, what the converter does to the quoting when you switch, what the sep= first line really is, and the count of quoted cells on the same export written five ways.ExplainerExtracting Every Email Address or URL from a Block of TextA URL at the end of a sentence keeps the full stop; an email address at the end of the same sentence does not. An accented first name in an address comes back truncated. Every case here was run through the tools and the exact output is reported.ComparisoncamelCase, snake_case, kebab-case: Which One, and Why You Rarely Get to ChooseThe conventions are not taste. A hyphen is the minus operator, so kebab-case cannot be an identifier in most languages - which is exactly why CSS and URLs use it. Plus the acronym round-trip that silently corrupts names, and the rule that fixes it.