Home Tools About Us β™₯ Support Us
πŸ” Regex Tester

Build, test &
explain regex

Match, substitute, list, and unit-test regular expressions with live highlighting, a plain-English breakdown, and a full cheat sheet β€” all in your browser.

/ /

βš™οΈ Live testing always runs on your browser's JavaScript (ECMAScript) regex engine. Flavor only changes the reference notes and exported code below β€” actual behavior in PHP/Python/Go/etc. may differ for advanced constructs.

Common Patterns

Click to load a ready-made pattern into the tester.

Test String

0 matches

Match Details

No matches yet β€” type a pattern and some test text above.

Plain-English Explanation

Enter a pattern above to see a token-by-token breakdown.

Code Export

Your pattern and flags formatted for the selected Flavor.

/(?:)/

πŸ•˜ Saved Patterns

Saved only on this device β€” never uploaded anywhere.

No saved patterns yet. Click "πŸ’Ύ Save" above.

Cheat Sheet

How to use every part of this tool

  1. Type a pattern in the slash-delimited field at the top β€” no need to add the surrounding slashes yourself.
  2. Toggle flags β€” g (global), i (ignore case), m (multiline anchors), s (dot matches newline), u (Unicode mode), y (sticky matching from lastIndex).
  3. Pick a Flavor to change the reference notes and the Code Export snippet β€” remember live testing always uses the JS engine.
  4. Use Match mode to see every match highlighted in your test string, with a detailed breakdown of index, length, and capture groups below.
  5. Use Substitution mode to preview a replace operation β€” type a replacement using $1, $<name>, $&, or $$.
  6. Use Match List mode to see every match in a table, then copy it or export as JSON/CSV.
  7. Use Unit Tests to paste a list of input || true/false lines and instantly see which ones pass or fail against your pattern.
  8. Read the Explanation panel for a plain-English, token-by-token breakdown of what your pattern does.
  9. Watch for the backtracking warning β€” it flags common risky shapes like nested quantifiers so you can rewrite them before they cause slowdowns.
  10. Copy ready-to-use code from the Code Export panel in your chosen language's regex literal syntax.
  11. Save patterns you use often, or click πŸ”— Share Link to copy a URL that reloads your exact pattern, flags, and test string for someone else.
  12. Browse the Cheat Sheet β€” switch between Anchors, Character Classes, Quantifiers, Groups, Lookarounds, Flags, and Substitution tokens.

One regex tool, every workflow

πŸ”
Live Match Highlighting
See every match, group, and boundary highlighted as you type β€” no button needed.
πŸ”
Substitution Preview
Test replace operations with full JS replacement-string syntax, including named groups.
βœ…
Unit Test Mode
Paste expected-match/no-match cases and instantly see pass/fail for each.
🧠
Plain-English Explanation
A token-by-token breakdown of exactly what your pattern does.
⚠️
Backtracking Warnings
Heuristic detection of risky nested-quantifier shapes before they slow you down.
🌐
12 Language Flavors
Reference notes and code export for JS, Python, PHP, Java, Go, Rust, .NET, Perl, Ruby, Scala, C, and C++.
πŸ“‹
Snippet Library
One-click common patterns β€” email, URL, IPv4, phone, date, and more.
πŸ“–
Categorized Cheat Sheet
Anchors, classes, quantifiers, groups, lookarounds, flags, and substitution tokens.

Regex fundamentals

A regular expression describes a search pattern instead of exact text β€” \d+ matches one or more digits, like 42, 2026, or 123456789.

TokenDescription
.Any character except a newline (unless the s flag is on).
\dAny digit (0–9).
\wLetters, digits, and underscore.
\sAny whitespace character.
*Zero or more of the preceding token.
+One or more of the preceding token.
?Zero or one β€” makes the preceding token optional.
[...]Any one character from the set inside the brackets.
(...)A capturing group.
^ / $Start / end of the string (or line, with the m flag).
πŸ“

Form Validation

Emails, usernames, phone numbers, ZIP/postal codes, and passwords before submission.

πŸ’»

Programming

Parsing config files, processing API responses, refactoring code, cleaning datasets.

πŸ“Š

Data Analysis

Extracting values from reports, logs, CSVs, and documents with structured patterns.

Best practices

Common mistakes

Frequently Asked Questions

No. Most languages share a common core but differ on advanced features like lookbehind, named groups, Unicode property escapes, and possessive quantifiers. The Flavor selector adjusts reference notes and the code snippet for the language you pick.

Matching always runs on your browser's built-in JavaScript (ECMAScript) engine, regardless of the Flavor selected. There's no way to run a real PHP, Python, or Go engine inside a browser, so advanced-construct behavior may differ slightly.

Yes. Switch to the Substitution tab, type a replacement using $1, $<name>, $&, or $$, and see the result live.

Yes. The live plain-English explanation breaks your pattern into tokens with descriptions, and the cheat sheet plus full reference section cover every construct with examples.

No. All matching, substitution, and explanation happens locally in your browser. Nothing you type is sent to or stored on our servers.

g finds all matches. i ignores case. m makes ^/$ match line boundaries. s lets . match newlines. u enables full Unicode mode. y anchors matching to the exact lastIndex position.

It runs a heuristic check for common risky shapes like nested quantifiers, e.g. (a+)+ or (.*)*, and shows a warning. It can't catch every case β€” always test risky patterns against realistic worst-case input.

Paste a list of test cases, one per line, as input || true or input || false, and the tool checks whether your pattern matches or doesn't match each one as expected.

Yes. The Match List tab has buttons to copy all matches or download them as JSON or CSV.

Yes. The Code Export panel formats your current pattern and flags as a literal for JavaScript, Python, PHP, Java, Go, Rust, C#, C++, Ruby, Perl, and Scala.

Related developer tools

Browse Other Categories

β™₯

Support EaseDev Studios

All tools are free. If they've saved you time, consider supporting us.

β˜•

Buy Us a Coffee

A quick one-time gesture that means a lot.

Buy a Coffee β†’
πŸŽ—οΈ

Become a Patron

Support us monthly and help build more tools.

Join on Patreon β†’