I need a regular expression that will match strings of letters that don't contain two consecutive dashes.
I came close to this regex that uses lookaround (I don't see an alternative):
([-a-z](?<!--))+
Why the following is indicated:
qsdsdqf - sqdfqsdfazer - azerzaer-azerzear
Produces three matches:
qsdsdqf-
sqdfqsdfazer-
azerzaer-azerzear
However, I want to:
qsdsdqf-
-sqdfqsdfazer-
-azerzaer-azerzear
So my regex is losing the first dash, which I don't want.
Who can give me a hint or regex that can do this?
source
share