<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 that demonstrate how to escape Unicode characters 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:


Escaping Unicode Characters in Regular Expresions

Use double backslashes \\\\ to escape the Unicode reference in a regular expression:

// \\\\u0027 escapes the apostrophes. 
// \\\\u2018 and \\\\u2019 handle left and right single quotes.
replaceAll("Mike 'Iron Mike' Tyson", "[\\\\u0027\\\\u2018\\\\u2019]","🥊")
// Output: Mike 🥊Iron Mike🥊 Tyson

Test

Escaping Double Quotations "

replace("Mike \\"Iron Mike\\" Tyson", ".*([\\\\u0022\\\\u201c\\\\u201d][^\\\\u0022\\\\u201c\\\\u201d]+[\\\\u0022\\\\u201c\\\\u201d]).*", "$1")
// Output: "Iron Mike"

Test


© Thomas Frank