text.cihat.dev

Find and replace

Swap a word, a name or a pattern everywhere in a text at once, and see how many places changed.

How to use it

  1. Paste the text.
  2. Type what to find and what to replace it with. Leave the replacement empty to delete every match.
  3. Tick Match case, Whole words only or Regular expression as needed, then copy the result.

Plain search, whole words and case

By default the search ignores case and matches inside words, so “cat” also finds “Category”. Tick Whole words only to match “cat” on its own, and Match case to leave “Cat” alone. Whole words work for every alphabet, including Turkish and accented letters.

Regular expressions

With Regular expression ticked, the find box takes JavaScript regex syntax with Unicode support. In the replacement, \n is a line break, \t a tab, $1 to $99 insert numbered groups, $<name> a named group, $& the whole match and $$ a dollar sign.

Patterns people use often
FindReplace withDoes
\s+ (one space)Turns runs of spaces and line breaks into single spaces
^\s+|\s+$(empty)Trims spaces at the start and end
(\w+), (\w+)$2 $1Turns “Smith, Anna” into “Anna Smith”
\n{3,}\n\nRemoves extra empty lines

Related tools

Clean a list with remove duplicate lines or sort lines, and check what changed between two versions with text compare.

Questions people ask

Can I replace a line break?

Yes. Tick Regular expression and find <code>\n</code>. To replace line breaks with a comma and a space, find <code>\n</code> and replace with <code>, </code>.

How do I delete a word everywhere?

Type it in Find and leave Replace with empty.

Why does my regex find nothing?

The match is case-insensitive unless you tick Match case, and special characters such as . ? ( ) [ ] need a backslash when you mean them literally. An invalid pattern shows an error under the result.

Is my text uploaded?

No. The replacement runs in your browser.