Test JavaScript regular expressions against sample text, with live highlighting and match details.
.Any character except newline\d \w \sDigit, word char, whitespace\D \W \SNegated versions of above^ $Start / end of string (or line with m)* + ?0+, 1+, 0-or-1 repetitions{n,m}Between n and m repetitions[abc]Character class[^abc]Negated character class(...)Capturing group(?:...)Non-capturing group(?<name>...)Named capturing groupa|bAlternation (a or b)\bWord boundary(?=...)Positive lookahead(?!...)Negative lookaheadA regular expression (regex) is a pattern used to match, search, or extract text. This tester runs your pattern against sample text using JavaScript's regex engine, highlighting every match and listing captured groups β safely, in a background worker with a time limit so a runaway pattern can't freeze your browser.
g (all matches), i (case-insensitive), m (multiline), s (dot matches newline), u (unicode).$1, $2β¦ for capture groups) to preview a find-and-replace.Pattern \b\w+@\w+\.\w+\b against the default text matches both email addresses. Try adding the i flag and typing [email protected] to see case-insensitive matching in action.
Certain regex patterns (like nested quantifiers, e.g. (a+)+$) can cause the engine to try an exponential number of combinations on some inputs, effectively hanging. This tool detects that by timing out and terminating the worker.
No β this uses JavaScript's native regex engine. Syntax is very similar to PCRE/Python but has some differences (e.g. lookbehind support varies by engine version).