Replace text across a whole document at once, with whole word, case sensitive and regular expression options.
Text is matched literally, so dots, brackets and slashes mean exactly what they look like.
0 lines out
Leave the replacement empty to delete every match instead of replacing it. The match count next to the result tells you immediately whether your search hit what you expected.
Whole word stops cat matching inside category. Case sensitive separates API from api. Regular expression turns the search box into a pattern.
The original is left untouched, so you can adjust the search and try again as many times as you like.
Leave the replace field empty. Every match is removed and the match count still tells you how many there were.
Anything JavaScript regular expressions support. \d+ for numbers, ^ and $ for the start and end of a line, character classes, quantifiers and capture groups. In the replacement, $1 and $2 insert what the groups captured.
Yes, and it is the best reason to use regular expression mode. Search for ^([^,]+), (.+)$ and replace with $2 $1 to turn a list of surname, forename into forename surname across the whole document at once. Use a character class like that rather than \w, because \w only covers the basic Latin alphabet and would cut a Turkish name in half.
Whole word is turned off in regular expression mode, because the two would fight over the same escaping. Add \b yourself at each end of the pattern instead.
The word boundary rule comes from JavaScript, which treats letters outside the basic Latin alphabet as boundaries. So kitap will match inside kitapçı. For Turkish, write the pattern explicitly rather than relying on the whole word option.
The count always shows every match in the document, while the replacement only touches the first one. It is deliberate: you can see how many there are before deciding to replace them all.
Something in it is not valid, usually an unclosed bracket or parenthesis, or a lone backslash. The exact message from the regular expression engine is shown so you can see which part it choked on. Test complex patterns in our regex tester first.
No. Everything runs in this tab, so it is safe for text you would not paste into an online service.
Free regex tester with live highlighting. Test regular expressions against your text in real time, with a library of common patterns and a replace mode.
Open ToolRemove repeated lines from a list, or keep only the unique ones, only the duplicates, the first or the last.
Open ToolJoin broken lines back into flowing text, keep paragraphs, or clean up the extra blank lines a paste left behind.
Open Tool