我想匹配仅包含已定义字符的整个单词(或真正的字符串)。
例如,如果字母是d
, o
, g
:
dog = match
god = match
ogd = match
dogs = no match (because the string also has an "s" which is not defined)
gods = no match
doog = match
gd = match
在这句话中:
dog god ogd, dogs o
...我希望匹配dog
, god
, and o
(不是ogd,
因为逗号或dogs
由于s
)