Regex Tester with Plain-English Explanations
Type a pattern and some test text to see every match listed with its position, length and capture groups. Start from presets for emails, URLs, US phone numbers, IPv4 addresses, dates, hex colours and HTML tags, or click Explain this Regex for a plain-English breakdown from an AI model. Patterns run on the .NET regex engine, which reads most JavaScript, Python and PHP patterns the same way, with a few differences covered below.
Built by Jose Hunt · Checked 20 Nov 2026
How to use
Enter a regex pattern and test string to see matches in real-time.
2-second timeout on each run.
- check_circle Live list of matches
- check_circle Capture groups & match details
- check_circle Plain-English AI explanations
What is a Regex Tester & Explainer?
A regex tester runs a regular expression against sample text and shows what it matches, so you can fix the pattern before it goes into code. Type a pattern, paste some text, and the tool lists every match with its index, its length and the value of each capture group. The list updates as you type.
The pattern runs on our server with .NET's System.Text.RegularExpressions engine. Everyday syntax behaves as it does in JavaScript, Python or PHP, but not all of it, so a pattern that works here can still behave differently in your code. Test it in the engine you'll ship with as well. The differences that bite most often are under How it works.
The Explain this Regex button is the only part that uses AI. It sends your pattern, not your test text, to an AI model through OpenRouter.
If your pattern lives in a JSON config file, every backslash has to be doubled there, so \d becomes \\d. Our guide to JSON parse errors explains why a lone \d breaks the file. To check the JSON itself, use the JSON Formatter.
When should you use it?
- check_circle Checking a form validation pattern against good and bad samples before it ships
- check_circle Pulling dates, IDs or amounts out of log lines and checking each capture group
- check_circle Working out what an inherited pattern does, with the AI explanation next to the live matches
- check_circle Testing a pattern for a .NET application, where this is the engine your code will use
Example outputs
How it works
The tool builds a .NET Regex from your pattern with no options set and a 2-second match timeout, then collects every match in the test text. For each match it shows the matched text, its index (counting from 0), its length and each capture group in order. Named groups are listed by number, not by name. Matching reruns whenever the pattern or the text changes. Matches appear in a list below the text; they aren't highlighted inside it.
There are no flag checkboxes. Switch options on inline at the start of the pattern: (?i) ignores case, (?m) makes ^ and $ match at every line break, (?s) lets . match a newline, and (?x) ignores spaces in the pattern (Microsoft Learn: regular expression options). Don't type JavaScript slashes. /\d+/g is read as a literal slash, digits, a slash and a g, so it matches nothing in ordinary text.
The biggest difference from JavaScript is character classes. In .NET, \d matches any Unicode decimal digit, so it matches Arabic-Indic ١٢٣ as well as 123, and \w covers letters in every script (Microsoft Learn: character classes). In JavaScript, \d is only [0-9] (MDN). .NET has an ECMAScript mode that narrows these, but it can only be set in code, not inline, so this tool always uses .NET's own rules.
Each run gets 2 seconds. The limit is there for catastrophic backtracking, where a pattern such as (a+)+$ tries an exploding number of paths on text that almost matches (Microsoft Learn: best practices). When the limit is hit, .NET throws a timeout error. The tool doesn't catch it, so the page stops working until you reload it. We saw this with (a+)+$ against 30 a's followed by an exclamation mark.
Explain this Regex sends "Explain this regex:" followed by your pattern to an AI model through OpenRouter. The system prompt tells the model to act as a regex expert, explain the pattern step by step in plain English, break down each part, and keep the answer under 200 words. The answer streams in as it's written and can differ between runs. It's shown as plain text, so Markdown marks such as ** and ### appear as typed. The model doesn't run your pattern, so check its explanation against the real matches.
Tips for better results
- tips_and_updates Paste text that should not match as well as text that should. A pattern that matches every good sample can still match bad ones.
- tips_and_updates Use a lazy quantifier when you want the shortest match. On "<b>bold</b> and <i>italic</i>", <.*> returned the whole line as one match, while <.*?> found the four tags.
- tips_and_updates If the pattern will also run in JavaScript, write [0-9] instead of \d so both engines match the same digits.
- tips_and_updates Avoid nested quantifiers such as (a+)+. Here they hit the 2-second limit; in production code they can stall a server.