<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5f290176-d74d-4847-824b-f173f3489a87/tfexplains-profile.jpg" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/5f290176-d74d-4847-824b-f173f3489a87/tfexplains-profile.jpg" width="40px" /> This page contains working examples for all supported anchors in Notion regular expressions. Duplicate this page to your workspace if you’re unable to view the formulas.

Regular Expressions in Notion Formulas

Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter

</aside>

📚 References:


Character Escapes

Character Classes

Quantifiers

Anchors

Character Grouping

Substitutions

Backreferences

Alternation


Unicode Numbers in Regular Expressions


Regular Expression Examples


Notion Formula Examples


📜 Table of Contents:


^ - start of line

replace("dogs dogs dogs", "^dogs", "cats")
// Output: cats dogs dogs

Test

$ - end of line

replace("dogs dogs dogs", "dogs$", "cats")
// Output: dogs dogs cats

Test

\\\\b - word boundary

replaceAll("martini art artist", "\\\\bart", "!!!")
// Output: martini !!! !!!ist

replaceAll("martini art artist", "\\\\bart\\\\b", "!!!")
// Output: martini !!! artist

Test

\\\\B - not on a word boundary

replaceAll("martini art artist", "\\\\Bart", "!!!")
// Output: m!!!ini art artist

Test


© Thomas Frank