Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
first(?:(?!and)[^;,.])*second
/
gm
Input 1
1
New
I would like it to match the following: first some word second But not match the following: first . some word second first ; some word second It is working but it is also excluding the following: blah ; first some word second