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
/
^[a-zA-Z](?!.*(['-]).*\1)(?!.* )(?=.{0,19}$)[a-zA-Z'-]*(?: (?<=[a-zA-Z] )[a-zA-Z][a-zA-Z'-]*)*$
/
gm
Input 1
New
This is aa This is aa test aa aa aa aa aa aa aa This should m'atch This a-lso' This is a test a b aa a This is 4 test This is aa test This' is aa tes This is aaaa longer test This sh'o'uld not This sh-o-uld not
Extraction
This is aa This is aa test aa aa aa aa aa aa aa This should m'atch This a-lso' This is a test a b aa a This is 4 test This is aa test This' is aa tes This is aaaa longer test This sh'o'uld not This sh-o-uld not