The function does not appear to work with a variable in version 5.5.9; tried it with a file content as well as a task output variable, and it appears to count the number of ccurences in the variable, not in the value of the variable.
Also, it seems to dislike the letter "N" when used as the match: "error parsing "\N" - Unrecognized escape sequence \N.]" (Lower case n is OK.)
The particular match that is being attempted is in output such as this (this is an example - it would need to be provided as the value of a variable such as a task output or file content as the number of occurences will vary on each job run.)
In 7633009065 2271 N/A
In 3017354389 1242 N/A
In ---N/A--- 9538 111 Unavail -
In ---N/A--- 9538 49
The desired match to count would be the N/A in the right column (surrounded by white space), but not in the left column (surrounded by hyphens.)