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
/
(?:sandwich|toastie)(?:(?!(?:ham|cheese|pickle|\w\. +|(?:\r?\n|\r))).){1,100}(?:ham|cheese|pickle)
/
gm
Input 1
1
New
Victorians enjoyed a good sandwich after work. They also enjoyed cheese rolling. sandwich test new line here test pickle Andy sat down to enjoy his sandwich which, unusally for him, was ham filled with delicious ham ham test cheese This is a sandwich with. ham or cheese.
Extraction
Victorians enjoyed a good sandwich after work. They also enjoyed cheese rolling. sandwich test new line here test pickle Andy sat down to enjoy his sandwich which, unusally for him, was ham filled with delicious ham ham test cheese This is a sandwich with. ham or cheese.