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
/
^([a-zA-Z]+?)([-\s'][a-zA-Z]+)*?$
/
gm
Test String
New
#should only start with alphabets John 1John -John John \John #Can contain spaces,- and ' but should not repeat consecutively, also there should be alphabets before and after allowed special chars John Doe John-Doe John's Doe John--Doe John Doe John' s John-Doe- #Other special chars not allowed John#Doe J0hn JON3
Substitution
Processing...