Regex Tester

Tech · Text

Free online regex tester. Test JavaScript regular expressions with live matches, flags, highlights, and capture groups - privately in your browser.

PatternEnter the pattern only, or paste a full /pattern/flags literal
Test string
Matches (0)

Enter a pattern and test string, or click Sample above.

Matches: 0Lines: 0Size: 0 B

Free online regex tester

Test regular expressions in your browser with live matches, flag toggles, highlighted previews, and capture groups. Paste a pattern and a test string to debug email validation, log parsing, search filters, and replacements - privately, with nothing uploaded.

What you can do

  • Live matching

    See every match update as you edit the pattern, flags, or test string - no server round trip.

  • Flags & groups

    Toggle g, i, m, s, u, and y. Inspect numbered capture groups and named groups for each match.

  • Private by default

    Patterns and test data stay in your browser. Ideal for debugging logs, validators, and scrapers.

How to use this regex tester

  1. Enter a regular expression in the pattern field (without surrounding slashes).
  2. Toggle flags such as g (global) and i (case-insensitive) as needed.
  3. Paste your test string - or click Sample for a quick example.
  4. Review matches, indices, and capture groups on the right; use the highlighted preview.
  5. Copy matches when you want the list on your clipboard.

Quick regex cheat sheet

  • . - any character (except newline unless s is on)
  • \d \w \s - digit, word character, whitespace
  • ^ / $ - start / end (of string, or line with m)
  • * + ? {n,m} - quantifiers
  • (abc) - capturing group; (?:abc) - non-capturing
  • [a-z] / [^0-9] - character class / negated class

Deeper walkthroughs: Common regex mistakes and What is a regular expression?.

Frequently asked questions

Learn more about regular expressions

Related tools: Timestamp converter, JSON formatter, URL encoder.

Why use an online regex tester?

Regular expressions are powerful and easy to get wrong. A visual tester shortens the loop when you are writing validators, search filters, log parsers, or find-and-replace rules. Running matches locally keeps sample data on your machine while you iterate on the pattern - and confirms behavior in the same JavaScript RegExp engine many web apps use.

Related tools