Developer Tool

Regex Tester

Test and debug regular expressions with live match highlighting, capture group extraction, replace, split, and 10+ preset patterns — all in your browser.

Current: g— hover a flag button for description

🔍

Enter a pattern above to see matches here.

Regex Quick Reference

Character Classes

  • . — any character (except newline)
  • \d — digit [0-9]
  • \w — word char [A-Za-z0-9_]
  • \s — whitespace
  • \D, \W, \S — negated versions
  • [abc] — one of a, b, c
  • [^abc] — not a, b, c
  • [a-z] — character range

Quantifiers

  • * — 0 or more (greedy)
  • + — 1 or more (greedy)
  • ? — 0 or 1
  • {n} — exactly n
  • {n,} — n or more
  • {n,m} — between n and m
  • *? +? ?? — lazy (non-greedy)

Anchors & Boundaries

  • ^ — start of string/line
  • $ — end of string/line
  • \b — word boundary
  • \B — non-word boundary

Groups

  • (abc) — capture group
  • (?:abc) — non-capture group
  • (?<name>abc) — named group
  • (?=abc) — lookahead
  • (?!abc) — negative lookahead
  • (?<=abc) — lookbehind
  • (?<!abc) — neg. lookbehind

Alternation & Escaping

  • a|b — a or b
  • \. \* \+ — escape literal
  • [.] — literal . inside class

Flags

  • g — global (all matches)
  • i — case insensitive
  • m — multiline (^/$ per line)
  • s — dot matches newline
  • u — Unicode mode

Free Online Regex Tester — Live Highlighting, Replace & Split

QuickToolkit's free regex tester lets you write, test, and debug regular expressions directly in your browser without installing anything. As you type your pattern, the tool instantly highlights every match inside your test string so you can see exactly what the regex captures. Whether you are validating form inputs, parsing log files, extracting data from HTML, or learning regex for the first time, the live feedback loop makes iteration fast.

The tool supports all standard JavaScript regex flags — g (global), i (case-insensitive), m (multiline), s (dot-all), and u (Unicode) — each toggleable with a single click. Match results show the matched text, its start index, character length, positional capture groups ($1, $2…), and named capture groups ((?<name>...)). The Replace tab lets you apply the regex as a substitution and copy the resulting string. The Split tab uses your pattern as a delimiter and lists every resulting part.

No data leaves your browser — the entire tool runs on JavaScript's native RegExp engine. Ten built-in preset patterns (email, URL, phone number, date, hex color, IP address, and more) get you started in seconds. A regex cheat sheet below the tool keeps common syntax within reach while you work.

How to Use the Regex Tester

  1. 1

    Enter your pattern or pick a preset

    Type a regular expression in the Pattern field, or click "Presets" to load a common pattern like email, URL, phone number, or date.

  2. 2

    Toggle flags

    Click the flag buttons to enable g (find all matches), i (ignore case), m (multiline), s (dot-all), or u (Unicode). Hover a button to see what each flag does.

  3. 3

    Paste your test string

    Enter the text you want to test in the Test String box. The highlighted preview below it updates live as you type, showing every match in yellow.

  4. 4

    Review matches

    The Match tab shows each match with its index, length, positional capture groups ($1, $2…), and named capture groups. An error message with a plain explanation appears if your regex is invalid.

  5. 5

    Use Replace or Split

    Switch to the Replace tab to apply a substitution (use $1 or $<name> to reference groups) and copy the output. Use the Split tab to tokenise a string by your regex delimiter.

Key Features

🟡

Live Match Highlighting

Every match in your test string is highlighted in real time as you type — no button press required.

🎛️

Toggle Flag Buttons

Click g, i, m, s, u buttons directly — no need to remember or type flag letters manually.

🔢

Capture Group Breakdown

See positional ($1, $2…) and named ((?<name>…)) capture groups extracted from every match.

✏️

Regex Replace

Apply your regex as a substitution with $1/$<name> references and instantly copy the result.

✂️

Regex Split

Use your pattern as a delimiter to split a string and see each resulting part numbered.

📋

10+ Preset Patterns

Load production-ready patterns for email, URL, phone, date, hex color, IP, and more in one click.

Clear Error Messages

Invalid patterns show a descriptive error immediately — no cryptic browser console needed.

🔒

100% Private & Client-Side

Everything runs in your browser using native JS RegExp. No text is ever sent to a server.

Common Use Cases

Form Validation

Build and test patterns for email addresses, phone numbers, passwords, postcodes, and credit card numbers before shipping them to production.

Log File Parsing

Extract timestamps, error codes, IP addresses, or request paths from server logs, application logs, or access logs.

Data Extraction

Pull structured data from unstructured text — e.g. scrape prices, product IDs, or dates from a copied webpage.

Search & Replace in Code

Test a find-and-replace pattern before running it in your editor (VS Code, IntelliJ, etc.) to avoid accidentally breaking code.

Input Sanitisation

Verify that a sanitisation regex correctly strips or replaces disallowed characters in user-submitted content.

Learning Regex

Experiment with quantifiers, anchors, lookaheads, and named groups interactively — instant feedback accelerates learning.

Frequently Asked Questions

🚀Share this tool with friends!

Help others discover this free tool. Share on your favorite platform!

💡 Did you know? QuickToolkit is 100% free, with no ads or signup required!