Numbers Exercises

REGEX in Apple Numbers

Last updated:

Short answer: REGEX makes a search pattern (regular expression) that you can use in functions such as COUNTMATCHES, TEXTBEFORE, SUBSTITUTE and COUNTIF. Syntax: REGEX(regular-expression, case-sensitive)

Explanation

REGEX makes a search pattern (regular expression) that you can use in functions such as COUNTMATCHES, TEXTBEFORE, SUBSTITUTE and COUNTIF. The pattern follows ICU syntax. \w+ means: one or more word characters.

Syntax

REGEX(regular-expression, case-sensitive)

Example

Count the words in “To count all words, use regex.” with COUNTMATCHES and a REGEX that matches word characters.

Formula: =COUNTMATCHES("To count all words, use regex.",REGEX("\w+"))
Result: 6

Frequently asked questions

What does REGEX do in Apple Numbers?

REGEX makes a search pattern (regular expression) that you can use in functions such as COUNTMATCHES, TEXTBEFORE, SUBSTITUTE and COUNTIF. The pattern follows ICU syntax. \w+ means: one or more word characters.

What is the syntax of REGEX?

The syntax is REGEX(regular-expression, case-sensitive).

More in this category

Practise it yourself

Type the formula yourself in a real exercise and see right away if your answer is correct. The first exercises are free.

Start practising