Imagine this scenario: You are making a report on recent changes since the last software update and only hours later you realize you’ve used the wrong version number.
What a painstaking experience that would be without find and replace each and every entry.
You’ll have to manually search through for the wrong version number and replace it with the correct version, one by one in the entire text.
Wouldn’t it be nice if you could just find all and replace them in one go?
Does Notion natively support find and replace?
At the time of writing this post in Jan-2023, Notion doesn’t natively support find and replace.
Though it has been on Notion’s radar since May 2019 and there has been no update.
Yerba on Twitter is even willing to sell their wife and kids for this to be added.
Using external tools
This is the most straightforward approach, you just need to copy over the text that you wish to change and paste it in the text editor of your choice. Run the find and replace command. Take the resulting text back to Notion. You can use the following tools
Classic text processors
Simple Online Tools
Using Notion database
It’s true that Notion doesn’t provide find and replace for in-page content but that isn’t necessarily true for databases. Using the Notion formula
replaceAll() we can achieve the same results as any other text processor with find and replace functionality.
As in the above image create a simple database with three two fields,
input that store the text we want to process over and the respective
replace text. Now create a formula property called
Result that will give us the required output. You can copy the formula from here.
replaceAll(prop("Input"), prop("Find"), prop("Replace"))
replaceAll() formula takes the
Input text and finds the
find text and for each occurrence found it replaces it with
Replace text and the resulting output is shown as
Find and replace Chrome extension
ℹ️ This is a reliable solution, just a messy workaround. Hence, doesn’t always works. Use with caution.
This hack was found by u/chi11estpanda on r/Notion, in this method you go through each occurrence and then replace the text after two additional clicks. It’s not perfect, not even a complete solution but hey far better than manually searching and replacing it all manually.
So, how does it work? Firstly you have to get this Find and Replace Chrome extension.
Head over to the page you want to do the changes.
Pattern matching with Regular expressions
Regular expressions are powerful tools for finding patterns in text.
They are composed of symbols, characters, and anchors which represent text that can be searched for.
By using character classes, brackets, and quantification, one can create powerful expressions to search for patterns.
/[A-Z]+/g will match all strings of capital letters in a document.
You can make use of regex101.com and regexr.com to create, test and learn more about regular expressions. Once you have the search pattern ready, you can make use of any find-and-replace tool that works with regular expressions. Notepad++ provides this functionality too. You can also use any online tool like pinetools.com/find-and-replace.
Regular expressions reference
/ expression / flags, i.e
/ hello\\?\\*\\\\/escape special characters with backslashes
()group with parentheses
- Character classes
\swhitespace (tabs, line breaks) ||
.any character (except newline)
[xyz]match any x, y, z
[J-Z]match any capital letters between J & Z.
[^xyz]NOT x, y, z
bob|alicematch bob or alice
z?zero or one occurrences
z*zero or multiple occurrences
z+one or multiple occurrences
hello worldexact match
^hellostart of the strings
world$end of the string
greedymatches longest possible part
lazymatches smallest possible part