Regex Tester & Builder (JavaScript)

Build and test ECMAScript regular expressions with live highlighting, flags and group details. Private by design—everything runs in your browser.

Pattern, Flags & Text

Tip: Ctrl/Cmd + K focuses the pattern. Ctrl/Cmd + Enter tests.

Results

No results yet.

Matches & Groups

Shows match index, ranges, and capture groups (group ranges require d if supported).

Note: This uses your browser’s ECMAScript regex engine. Some PCRE tokens (e.g., atomic groups) aren’t supported.

Understanding Regular Expressions

A Regular Expression (Regex) is a pattern for matching text. Use them to search, validate, and replace.

Common examples

  • Email: ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$
  • IPv4: ^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$
  • ISO date (YYYY-MM-DD): ^\d{4}-\d{2}-\d{2}$

Character classes

. any char · \w/\d/\s word/digit/space · [a-z] ranges

Anchors

^ start · $ end · \b word boundary

Groups & lookaround

(…) capture · (?:…) non-capture · (?=…)/(?!…) lookahead

Quantifiers

*/+/? · {m,n} · +? lazy

Explore more tools