Skip to content

Regex Tester

Pattern
JavaScript pattern only (no surrounding slashes). Updates in real time.
Text
Matches below will highlight instantly as you type.

Options

Flag: g
Global search — find all matches, not just the first.
Flag: i
Ignore case — case-insensitive matching (A = a).
Flag: m
Multiline — ^ and $ match line starts/ends, not just the whole string.
Flag: s
DotAll — make . match newline characters as well.
Flag: u
Unicode — enable full Unicode mode; recommended for modern text.
Flag: y
Sticky — match must start exactly at lastIndex (useful for incremental scans).
Flag: d
Indices — expose start/end indices for the full match and capture groups (browser-dependent).

About the Regex Tester

Live-test JavaScript regular expressions in your browser. As you type, matches are highlighted below and a detailed text report is generated for copying or sharing.

Quick Regex Guide

  • Literals & escaping: most characters match themselves. Use backslash to escape (e.g. \. for a literal dot).
  • Common classes: \d digits, \w word chars, \s whitespace. Uppercase negates: \D, \W, \S.
  • Anchors: ^ start, $ end; with m they apply per line.
  • Quantifiers: a* 0+, a+ 1+, a? 0/1, a{2,5} range. Add ? to make non-greedy: +?, *?.
  • Groups: (...) capture; (?:...) non-capture; named capture (?<name>...).
  • Alternation: a|b matches either side.
  • Lookarounds: (?=...) ahead, (?!...) neg-ahead, (?<=...) behind, (?<!...) neg-behind.
  • Flags: g all matches, i ignore case, m multiline, s dotAll, u Unicode, y sticky, d indices.

Examples

  • Email (simple): \b(\w+)@([\w.-]+)\.(\w+)\b
  • ISO date: \b(\d{4})-(\d{2})-(\d{2})\b
  • Price: \$\d+(?:\.\d{2})?

Tips

  • Prefer u flag for modern text handling.
  • Use non-capturing groups (?: ) when you don’t need captured values.
  • Beware of catastrophic backtracking with nested, ambiguous quantifiers.
Related Tools
About this collection

Each page is built around one practical task. Enter what you need, review the result, and use the actions provided by the tool.

What to expect

  • Inputs and results kept together
  • Layouts that adapt to smaller screens
  • Direct links for returning to a tool
  • No account needed for the listed utilities

Need something else? Request a tool.