Find & Replace is a free online tool that allows you to easily search for a letter, number, word, or phrase in your text document and substitute it with something else. It can be very useful when it comes to editing a huge chunk of text. This tool will automatically find all exact matches and replace them all in a single click of a button.
Find & Replace is pretty straightforward to use.
The File Reader only supports opening plain text documents such as .txt
, .html/.htm
, .css
, .js
, .bat
, .nfo
and .md
. If you are working on a rich text editor, you can just directly copy your content in the text box.
Find & Replace gives you an option to use Regular Expressions to perform a more complex type of search and replace operations. Below is a list of basic examples that you can use as a cheat sheet.
Using the or condition to search for multiple words.
one two three
one|two|three
and Replace with: number
number number number
Switching the positions of the words.
hello world
(hello) (world)
and Replace with: $2 $1
world hello
Wrapping a word.
This is a sample text
(sample)
and Replace with: <b>$1</b>
This is a <b>sample</b> text
Replace only if followed by certain characters. For negation, simply replace =
with !
.
upgrade
up(?=grade)
and Replace with: down
downgrade
Matching an unknown number.
width="356"
width="([0-9]+)"
and Replace with: width="100%"
width="100%"
You must place a backslash '\' before a special character. The tool will generate an error message that says: "SyntaxError: Invalid regular expression: / . ^ $ * + ? \ [ ( { |/: Unterminated character class" if you have forgotten to escape the backslash .
For example, to match Where? use Where\? - the \? is taken to mean ?.
Where?
Where\?
and Replace with: What?
What?