Regex Replace

Find & replace with regular expressions — live diff preview, backreferences, 10 presets.

Match (input) Removed Inserted

Presets

PatternDescription
.Any character except newline (use s flag to include newlines)
\d / \DDigit / Non-digit [0-9]
\w / \WWord character / Non-word [a-zA-Z0-9_]
\s / \SWhitespace / Non-whitespace
^ / $Start / End of string (or line with m flag)
\b / \BWord boundary / Non-word boundary
[abc]Character class — matches a, b, or c
[^abc]Negated class — anything except a, b, c
[a-z]Range — any lowercase letter
a|bAlternation — matches a or b
*Zero or more (greedy)
+One or more (greedy)
?Zero or one (makes quantifier lazy when appended)
{n} / {n,m}Exactly n / Between n and m repetitions
(abc)Capturing group
(?:abc)Non-capturing group
(?<name>abc)Named capturing group
(?=abc) / (?!abc)Positive / Negative lookahead
(?<=abc) / (?<!abc)Positive / Negative lookbehind
TokenDescription
$1, $2, …Captured group by number
$<name>Named capture group
$&Entire matched substring
$`Text before the match
$'Text after the match
$$Literal dollar sign $