Regex Tester
. Any character except newline\d Any digit [0-9]\D Any non-digit [^0-9]\w Any word character [a-zA-Z0-9_]\W Any non-word character\s Any whitespace character\S Any non-whitespace character[abc] Match any character in the set[^abc] Match any character not in the set[a-z] Match a character in the range* Zero or more+ One or more? Zero or one (optional){n} Exactly n times{n,} n or more times{n,m} Between n and m times*? Zero or more (lazy)+? One or more (lazy)^ Start of string$ End of string\b Word boundary\B Non-word boundary(abc) Capturing group(?:abc) Non-capturing group(?<name>abc) Named capturing group\1 Backreference to group 1a|b Match a or b(?=abc) Positive lookahead(?!abc) Negative lookahead(?<=abc) Positive lookbehind(?<!abc) Negative lookbehindHow to Use
Enter a regex pattern and flags (g for global, i for case-insensitive, m for multiline, s for dotAll, u for unicode). Type test text below to see matches highlighted in real time, including capture groups and match positions. Switch to the Replace tab for substitution, or scroll down for pattern explanation, code snippets, and a quick reference.
Regular Expression Flags
g (global) finds all matches, not just the first. i (case-insensitive) ignores letter case. m (multiline) makes ^ and $ match line boundaries. s (dotAll) makes . match newlines. u (unicode) enables full Unicode matching. d (hasIndices) provides start/end indices for capture groups.
Privacy
All regex evaluation happens entirely in your browser using JavaScript's built-in RegExp engine. No patterns or test strings are sent to a server, stored, or logged.