REGEX: find all instances of value in a string

I’m using a regex to find bits of a string that indicate the “way” part of an address:
(?i)\b(ROAD|STREET|HILL|GREEN|AVENUE)\b

I want to count the number of those “way” indicators in a cell. I’m replacing with €, and then will count those. But I can only get one returned per cell.

I want the result A2=1, A3=3

Is there a fix, or should I try another way?

string REGEX(cell,wayIndicatorRegex,€)
ROBERTS ROAD ROBERTS €
HILL GREEN ROAD € GREEN ROAD

The fourth term of the regex can be “g” to sub every value found:

REGEX(cell,wayIndicatorRegex,"€","g")

string REGEX(B2,wayIndicatorRegex,“€”,“g”)
ROBERTS ROAD ROBERTS €
HILL GREEN ROAD € € €
1 Like