Regex Tester

Test and debug regular expressions in real-time. See matches highlighted, capture groups, and detailed match information.

Regular Expression

//g

Flags

Global (g)

Find all matches

Case Insensitive (i)

Ignore case

Multiline (m)

^ and $ match line start/end

Dot All (s)

. matches newlines

Unicode (u)

Enable Unicode support

Sticky (y)

Match from lastIndex only

Test String

Highlighted Matches

No matches

Quick Reference

Character Classes

  • . - Any character
  • \d - Digit [0-9]
  • \w - Word [A-Za-z0-9_]
  • \s - Whitespace
  • [abc] - Any of a, b, c
  • [^abc] - Not a, b, c

Quantifiers

  • * - 0 or more
  • + - 1 or more
  • ? - 0 or 1
  • {n} - Exactly n
  • {n,} - n or more
  • {n,m} - Between n and m

Anchors

  • ^ - Start of string
  • $ - End of string
  • \b - Word boundary
  • \B - Non-word boundary

Groups & Lookaround

  • (abc) - Capture group
  • (?:abc) - Non-capture
  • (?=abc) - Lookahead
  • (?<name>) - Named group
  • a|b - Or

About Regex Tester

Test and debug regular expressions in real time. Enter a pattern and a test string to see matches highlighted instantly, along with detailed match information including capture groups.

The tester uses the JavaScript (ECMAScript) regex engine — the same one that runs in Node.js and every browser — so what works here works in your JS code. Patterns and test data stay on your device.

Key Features

  • Live match highlighting as you type
  • Shows capture groups and match details
  • Standard JavaScript regex flags
  • Client-side only — test data never leaves your browser

Frequently Asked Questions

Which regex flavor does this tester use?

The JavaScript (ECMAScript) flavor, as implemented by your browser. Patterns validated here behave identically in Node.js and frontend JavaScript.

What are regex flags?

Flags modify how a pattern matches — for example g finds all matches instead of the first, i makes matching case-insensitive, and m changes how ^ and $ behave across lines.

What are capture groups?

Parentheses in a pattern create capture groups that extract sub-parts of a match — like pulling the year, month, and day out of a date string. The tester shows each group’s captured value.