Regex Tester

Write and test regular expressions with live match highlighting. Inspect capture groups, use all flags. JavaScript RegExp engine — results update as you type.

/ /
Test String no pattern
Match Highlights
Capture Groups & Matches
Run a pattern to see capture groups
Quick Reference — click to insert

// faq

Regex questions

Common questions about regular expressions.

What regex flavour does this use?
This tester uses JavaScript's built-in RegExp engine (ECMA-262). It supports lookaheads (?=), lookbehinds (?<=), named capture groups (?<name>), non-capturing groups (?:), Unicode properties \p{} with the u flag, and all standard quantifiers and character classes.
What do the flags mean?
g (global) finds all matches rather than stopping after the first. i (case insensitive) makes the pattern match regardless of letter case. m (multiline) makes ^ and $ match the start/end of each line. s (dotAll) makes the dot . match newline characters as well.
How do I use capture groups?
Wrap part of your pattern in parentheses to create a capture group: (\w+)@(\w+). Each group is numbered from 1. Named groups use the syntax (?<name>\w+) and can be referenced by name. All matched groups are shown in the Capture Groups panel below the test string.