正则表达式修饰符:cat|dog|fish

在文本 "We have three dogs, one fish, but no cats" 中,"cat"、"dog" 或 "fish" 出现了多少次:

3

匹配到的位置如下:

We have three #s, one #, but no #s

(每个匹配项都被替换为 # 字符)