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
r"
(?=^(?:(?!key[12]).)*$)^.*?(?=\s\d+)
"
gm
Input 1
1
New
this is a number 123456789 and there aren't any keys here. we might have a lot of words here as well but no key words this is a number 123456789 but we have their key1 here. key2 might be in the second or the third sentence. hence we can't remove everything after the given number
Substitution
this is a number 123456789 and there aren't any keys here. we might have a lot of words here as well but no key words this is a number 123456789 but we have their key1 here. key2 might be in the second or the third sentence. hence we can't remove everything after the given number