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
/
^(?!.*\b(?:dirty|rotten)\b)(?:(?!(?:apple|peach|pear)).)*(?:red|green|yellow)\b.*\b(?:apple|peach|pear)\b.*$
/
gm
Input 1
1
New
I have an green apple I have a yellow peach I have red and green apples I have a dirty red apple I have a green peach that is dirty I have a yellow dirty apple This is a green pear This is a rotten green pear This is pear, a green pear