Skip to main content

COUNTMATCH

Use the COUNTMATCH function to get the number of items in the array that match the regular expression pattern.

Use

COUNTMATCH( array, pattern )
Counts the number of items in the array that match the regular expression pattern.

ParameterRequiredDescription
arrayYesa Text, Choice, Date, Time or Date/Time array
patternYesa regular expression that determines which items will be counted

ReturnsNumber

Use with literals

COUNTMATCH({"a", "b", "1", "248", "", BLANK}, "[0-9]")

returns 2

COUNTMATCH({"A", "B", "C", "d", "e", BLANK}, "[A-Z]")

returns 3

COUNTMATCH({DATE(2024,1,1), DATE(2024,1,1), DATE(2023,1,1)}, "2024")

returns 2

Use with fields

COUNTMATCH(@Review.out.Notes, "[0-9]{2,}")

if field @Review.out.Notes contains 4 items with values "hello", "12", "123" and "7", returns 2