match

Learn how to use the match function in Notion formulas.

The match() function returns all matches of the regular expression as a list.

match(string, string)

string.match(string)
Code language: JavaScript (javascript)
match("Thomas 123 Frank 321", "\d+") /* Output: ["123", "321"] */

"Crew includes Luffy, the captain, Sanji, the cook, Nami, the navigator, and several others"
  .match(
    "(?<!^)[A-Z]\w+\b"
  )
Code language: JavaScript (javascript)

The second example here uses a negative lookbehind to ensure the match doesn’t start at the beginning of the string. This prevents the word “Crew” from being included in the matches.

About the Author

My name is Thomas Frank, and I'm a Notion-certified writer, YouTuber, and template creator. I've been using Notion since 2018 to organize my personal life and to run my business and YouTube channel. In addition to this formula reference, I've created a free Notion course for beginners and several productivity-focused Notion templates. If you'd like to connect, follow me on Twitter.

🤔 Have an UB Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas

🤔 Have a Question?

Fill out the form below and I’ll answer as soon as I can! ~Thomas