<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 character escapes in Notion regular expressions. Duplicate this page to your workspace if you’re unable to view the formulas.

Regular Expressions in Notion Formulas - Thomas Frank

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:


You can find a list of all Unicode, octal, and hexadecimal reference codes here:

Unicode

\\\\u0000 - escaped Unicode reference

test("A","\\\\u0041") // Output: True

Test

\\\\000 - octal character reference

test("A","\\\\101") // Output: True

Test

\\\\x00 - hexadecimal character reference

test("A","\\\\x41") // Output: True

Test

\\\\n - new line

replaceAll("Apple\\nBanana\\nOrange", "\\\\n", "\\n\\n")
/* Output:
Apple

Banana

Orange

Test

Single Character Escapes

There are also several characters that must escaped with double backslashes (\\\\) in order to be represented normally. These characters are used as special characters within regular expressions if they are not escaped.

Character Escape
Period - . \\.
Question mark - ? \\?
Dollar sign - $ \\$
Asterisk - * \\*
Plus sign - + \\+
Caret - ^ \\^
Left parenthesis - ( \\(
Right parenthesis - ) \\)
Left bracket - [ \\[
Right bracket - ] \\]
Left curly brace - { \\{
Right curly brace - } \\}
Pipe -
Forward slash - / \\/
Backslash \ \\\\

© Thomas Frank