Find and Replace
Find and replace in text with plain search or regular expressions, capture groups in the replacement, whole-word and case options, and a count of replacements.
Free · No sign-up · Your inputs stay in your browser
Input
Find and replace text, with regex
Output
Result
3 replacements
JavaScript regex syntax, with ^ and $ matching at each line. The same replacement in a terminal is sed -E 's/pattern/replacement/g' file (with \1 instead of $1), or in a whole project, rg -l 'pattern' | xargs sed -i ... after checking the matches.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Regex replacements
Capture groups turn find and replace into a transformation: (\w+)@(\w+)\.com with $2: $1 reorders parts of every match. The String.replace reference documents the replacement patterns.
Across files
For a whole project, rg -l 'pattern' lists the files that match and sed -i -E 's/pattern/replacement/g' edits them (with \1 instead of $1); review the matches before running the sed. Editors' project-wide replace with a preview is safer still.