Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^(?:(?=.*\bbig dog\b)(?!.*\bcat\b)|(?!.*\bbig dog\b)(?=.*\bcat\b)).+$
/
gm
Input 1
New
That big dog and cat went to town. The dog and cat went to town. The dog went to town The cat went to town
Extraction
That big dog and cat went to town. The dog and cat went to town. The dog went to town The cat went to town