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
/
\b(?:[\w'-]{1,3}\W+[\w'-]{4,}|[\w'-]{4,}\W+[\w'-]{1,3}|[\w'-]{4,})\b
/
g
Input 1
An elephant in the garden history of elephants Algebra A B-movies Have you visted Calculus A? I was in Calculus b
Substitution
An elephant in the garden history of elephants Algebra A B-movies Have you visted Calculus A? I was in Calculus b