Developers

Regex Tester: How to Write and Debug Regular Expressions

Test regex patterns with live match highlighting, capture groups, and flags — free in your browser with a quick-reference guide.

How to test a regex pattern for free

To test a regex pattern, open the ToolCrix Regex Tester, type your regex in the top field, paste your test text below, and matches highlight live as you type. Capture groups are listed separately. Toggle flags (g, i, m, s) to change behaviour. Everything runs in your browser.

Need to write, test or debug a regular expression quickly without signing up for anything? This free browser regex tester gives live match highlighting, capture-group breakdown and a quick-reference guide — no upload, no sign-up.

What is a regular expression?

A regex (regexp) is a pattern that matches, finds or replaces text. It's a concise, powerful mini-language supported in virtually every programming language and text editor. A single regex can validate an email address, extract all URLs from a document, or reformat thousands of dates in seconds.

How to test a regex (step by step)

  1. Open the Regex Tester.
  2. Type your regex pattern in the top field — no delimiters needed, just the pattern.
  3. Paste or type test text in the text area.
  4. Matches highlight in real time as you type or edit the pattern.
  5. Each capture group is listed separately below the matches.
  6. Toggle flags: g (global), i (case-insensitive), m (multiline), s (dotAll).

Common regex patterns to get started

  • ^[\w.-]+@[\w.-]+\.\w{2,}$ — validates an email address.
  • \b\d{3}[-.]?\d{3}[-.]?\d{4}\b — matches a US phone number.
  • https?://[^\s/$.?#].[^\s]* — extracts URLs from text.
  • ^[A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}$ — matches a UK postcode.
  • \b(0|[1-9]\d*)(\.\d+)?\b — matches any decimal number.

Regex flags explained

  • g (global) — find all matches, not just the first.
  • i (case-insensitive) — treat uppercase and lowercase as the same.
  • m (multiline) — ^ and $ match start/end of each line, not just the whole string.
  • s (dotAll) — . matches newline characters too.

Frequently Asked Questions

Does it show capture groups?

Yes — each group is listed separately with the text it captured.

Is my data uploaded?

No, all matching runs locally in your browser.

Try it now: open the free Regex Tester, or browse more developer guides.

Open the tool →