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
/
someword\s+(?:\S+\s+){1,3}otherword
/
gi
Input 1
1
New
someword aaa otherword someword aaa bbb otherword someword aaa bbb ccc otherword someword aaa bbb ccc ddd otherword someword aaa bbb ccc ddd otherword someword aaa otherword someword aaa bbb ccc otherword someword aaa bbb ccc ddd otherword someword aaa bbb otherword
Extraction
someword aaa otherword someword aaa bbb otherword someword aaa bbb ccc otherword someword aaa bbb ccc ddd otherword someword aaa bbb ccc ddd otherword someword aaa otherword someword aaa bbb ccc otherword someword aaa bbb ccc ddd otherword someword aaa bbb otherword