Regex Tester

Test a regular expression live, with match highlighting, capture groups, and quick presets.

Runs in your browserNo sign-up required
Pattern
//gi
Test String
2 matches
Highlighted Result
Contact us at hello@kravoy.com or visit https://kravoy.com. Alternate email: support@kravoy.com Call 9876543210 for help. Server IP: 192.168.1.1
#MatchIndexGroups
1hello@kravoy.com14—
2support@kravoy.com77—

See Every Match, Instantly

Writing a regular expression usually means a cycle of guess, run, and squint at the output. This tool collapses that loop — matches highlight directly inside your test text as you type either the pattern or the text, with a full breakdown of every match's position and capture groups below, plus one-click presets for the patterns people search for most (email, URL, phone number, and more).

Useful for: developers writing form validation, QA engineers testing input patterns, and data analysts cleaning or extracting text from messy files.

How to Use This Tool

  1. 1Type or paste a regular expressionOr start from a common preset like email, URL, or phone number.
  2. 2Toggle flags as neededGlobal, ignore-case, multiline, dot-all, unicode, and sticky — each with a tooltip explaining it.
  3. 3Paste your test textMatches are highlighted directly in the text as you type either field.
  4. 4Check the match tableSee every match's exact position and any capture groups it contains.

Understanding Regex Flags

  1. 1g (global) — find every match, not just the firstWithout it, most engines stop after the first match. This tool always searches globally for highlighting, regardless of your flag choice, so you can see every match at a glance.
  2. 2i (ignore case) — "Cat" matches "cat"Makes the entire pattern case-insensitive, useful when you don't want to write out every capitalization variant manually.
  3. 3m (multiline) — ^ and $ match line starts/endsWithout this flag, ^ and $ only match the very start and end of the whole string, not each line within it.
  4. 4s (dot-all) — . also matches newlinesBy default, . matches any character except a newline. This flag makes it match newlines too, useful when a pattern needs to span multiple lines.

Frequently Asked Questions

Why does my pattern match fewer things than I expect?

The most common cause is a missing "g" (global) flag, or "i" if your text has mixed capitalization your pattern doesn't account for. Try enabling both and check the match table.

What do the numbers in the "Groups" column mean?

They're the capture groups from your pattern — the parts wrapped in parentheses `(...)`. Each match can have multiple groups; they're shown in order, separated by commas.

Is my text or pattern sent anywhere?

No — regex matching runs entirely in your browser using JavaScript's built-in RegExp engine. Nothing you type here is transmitted anywhere.

Why does this tool say my regex is invalid?

JavaScript's regex engine has specific syntax — a common cause is an unescaped special character (like a literal `.` or `(` that should be `\.` or `\(`), or mismatched parentheses/brackets. The error message shown comes directly from the JavaScript engine and usually points at the exact issue.

Does this use JavaScript regex syntax specifically?

Yes — since it runs in your browser, matching follows JavaScript's RegExp rules, which are very close to (but not identical to) PCRE or Python's `re` module. Most common patterns behave the same across all three.

Is this regex tester free to use?

Yes, completely free, with no sign-up and no limit on how much you test.