次の文字列のみを検出したいと思います。
pets ok
pets yes
pets allowed
pets accepted
pets is/are allowed
pets is/are accepted
pets will be considered
pets will considered
pets is/are considered
pet friendly
そして同じことを逆にします:
ok pets
yes pets
...
(上記と同じ、最初から最後まで「ペット」/「ペット」のみ)
私はこれを理解することはできません。
明らかに機能していない現在のパターンを改善するのを手伝っていただければ、お願いします。
/\\b(pet(?:s)?\\s[negotiable|ok|o\\.k|friendly|accept|allow|possible]+|[ok|yes|accept]+\\spet(?:s)?|pet(?:s)?\\s[will|will\\sbe]+\\s[consider|allow|accept|possible]+)\\b/i"