Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
someword\s+(?:\S+\s+){1,3}otherword
/
gi
Test String
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
Substitution
Processing...