<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 substitutions 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:


$n - capture group numbers

replace("Dog Blog", "(Dog) Blog", "$1")
// Output: Dog

replace("Dog Blog", "(Dog) (Blog)", "$2")
// Output: Blog

Test

$& - copy of the whole match

replaceAll("Hello", ".*", "$& $& $&")
// Output: Hello Hello Hello

replaceAll("I sell pan and pan accessories", "pan", "pro$&e")
// Output: I sell propane and propane accessories

Test

`$`` - copy of the entire input string before the match

replace("badboy","boy","$`")
// Output: badbad

Test

$' - copy of the entire input string after the match

replace("badboy", "bad", "$'")
// Output: boyboy

Test


© Thomas Frank