About this tool
Search and replace text with optional regular expressions, all in your browser.
With regex off, the find text is matched literally, so characters such as . * ( and ? match themselves, and a $ in the replacement is inserted as a plain dollar sign. With regex on, the find field is a JavaScript regular expression and the replacement can use $1, $2 and similar references to captured groups. The case-insensitive option adds the i flag.
If the find field is empty, the output is the input unchanged. In regex mode only the global and case-insensitive flags are used, so ^ and $ match only at the very start and end of the whole text, not at each line.
Frequently asked questions
Can I use regular expressions?
Yes, enable regex to treat the find field as a pattern with capture groups like $1 in the replacement.
What happens with an invalid pattern?
If the regex is invalid, an error message appears and the output keeps the last valid result.
Why did my $ show up literally in the output?
In plain mode the replacement is inserted exactly as typed, including dollar signs. Turn on regex mode if you want $1 style references to captured groups.
Can I replace only the first match?
There is no switch for it: every match is replaced. A pattern starting with ^ only matches at the start of the whole text, which limits a change to that spot.
More tools