Find and Replace
Find and replace text in bulk. Choose case sensitivity, replace the first or all matches, and use regular expressions with capture groups.
Find and replace text in bulk. Choose case sensitivity, replace the first or all matches, and use regular expressions with capture groups.
Replace one piece of text with another across a whole document in one step. By default the match is literal, so characters like . and * are treated as normal text.
Turn on regular expressions for pattern matching, and use $1, $2 in the replacement to reuse parts of the match.
Find: (\w+) (\w+) Replace: $2 $1 John Smith -> Smith John
Literal replacement scans the text for an exact sequence of characters and swaps each occurrence, so searching for 1.5 matches only those three characters. Regular expressions describe patterns instead. A dot matches any character, a star means zero or more of the previous item, and a backslash followed by d matches a digit. Parentheses create capture groups, which the replacement can reference as $1, $2 and so on. Swapping a name format, for example, finds two words in groups and writes them back in reverse order, which is impossible with plain search.
Regex mode brings pitfalls. Quantifiers are greedy by default, so a pattern like a.*b matches from the first a to the last b on the line, while a.*?b stops at the first b. Special characters such as the dot, plus, brackets and parentheses must be escaped with a backslash when you want them literally. Case insensitive matching changes only matching, not the replacement text. Always check the replacement count, and consider testing the pattern on a short sample first. Poorly written patterns with nested quantifiers can run very slowly on large inputs.
Yes, JavaScript regular expressions. Tick Regular expression.
In regex mode, $& is the whole match and $1, $2 are capture groups.
No match was found. Check the spelling, case sensitivity and, in regex mode, the pattern.
No. It is processed in your browser.
In regex mode a dollar followed by a digit is a group reference. To write a literal dollar sign before a number, use two dollar signs in the replacement.
The dot does not match newlines by default. Use a pattern such as a character class that includes whitespace, for example backslash s or backslash n, to span line breaks.