100% browser-based · zero uploads

Regex Tester

Test regular expressions online for free — real-time match highlighting, capture group inspection, and flag toggles. No sign-up, no account, nothing leaves your browser.

//
Match Highlights
Matches will be highlighted here…

How It Works

1

Enter your pattern

Type or paste a regex into the pattern field. Syntax errors are caught immediately — no guessing where it went wrong.

2

Pick flags

Toggle g, i, m, s, or u flags to control how your pattern matches — case-insensitive, global, multiline, and more.

3

Paste test text

Drop any text into the Test String panel. Every match lights up in yellow in real time — nothing is sent anywhere.

4

Inspect matches

The Match Details panel shows each match's value, character position, and the value of every capture group.

How to Use the Regex Tester

  1. Type or paste your regular expression into the pattern field between the two / delimiters.
  2. Click the flag buttons (g, i, m, s, u) to enable or disable matching options.
  3. Paste or type the text you want to search in the Test String panel — matches highlight instantly.
  4. Check the Match Details panel to see each match's value, index, and capture group values.
  5. Click Copy pattern to copy the full regex (including delimiters and flags) to your clipboard.

Features

  • Real-time highlighting: Matches update as you type — no button to press.
  • Flag toggles: Toggle g (global), i (case-insensitive), m (multiline), s (dotAll), and u (unicode) with a single click.
  • Inline error reporting: Invalid regex patterns display a precise error message directly below the pattern field.
  • Match Details panel: Every match shows its value, start index, end index, and numbered or named capture group values.
  • Match count badge: Instantly see how many matches were found.
  • Copy pattern: One click copies the full regex literal (e.g. /pattern/gi) to your clipboard.
  • Sample regex: Load a working email-matching pattern and test string to explore the tool instantly.
  • Your data stays private: Everything runs in your browser using JavaScript's native RegExp — nothing is uploaded, stored, or logged.
  • No account required: Open the page and start testing straight away.
  • Works offline: Pure JavaScript — once the page has loaded, no network connection is needed.

Regex Flag Reference

Flag Name Effect
g global Find all matches; without it only the first match is returned.
i case-insensitive Treat uppercase and lowercase letters as the same.
m multiline ^ and $ match the start and end of each line, not the entire string.
s dotAll The . metacharacter matches newlines (\n, \r) in addition to other characters.
u unicode Enable full Unicode support, including emoji, surrogate pairs, and \p{} property escapes.

Frequently Asked Questions

Is my regex pattern uploaded to your servers?

No. All matching happens locally in your browser using JavaScript's native RegExp engine. Your patterns and test strings never leave your device.

Which regex flavour does this tester support?

The tester uses the JavaScript (ECMAScript) RegExp engine built into your browser — the same engine used by Node.js. It supports named capture groups ((?<name>…)), lookaheads, lookbehinds, and the u and s flags from ES2018.

How do I use capture groups?

Wrap part of your pattern in parentheses, e.g. (\w+)@(\w+). Each set of parentheses creates a numbered group. Named groups use the syntax (?<name>\w+). The Match Details panel shows the value of every group for each match.

What does the global (g) flag do?

Without the g flag the regex stops after the first match. With g enabled, the tester finds every non-overlapping match in the test string and lists them all in the Match Details panel.

Does the regex tester work offline?

Yes. The tool is pure client-side JavaScript — once the page has loaded in your browser, it works without any internet connection.

Does the tester support lookaheads and lookbehinds?

Yes — the JavaScript engine supports positive and negative lookaheads ((?=…), (?!…)) and positive and negative lookbehinds ((?<=…), (?<!…)) in all modern browsers (Chrome 62+, Firefox 78+, Safari 16.4+).