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
/
(?:\G(?!\A)|Divider)[^-\n]*\K-
/
gm
Input 1
1
New
a-b-Divider-Any-Text ----> a-b-Divider__Any__Text a-b-c-Divider-w-x-y-z ---> a-b-c-Divider__w__x__y__z a-b-c-d-e-f-g-h-i-j ------> a-b-c-d-e-f-g-h-i-j (nothing replaced, since no Divider)
Substitution
__
a-b-Divider-Any-Text ----> a-b-Divider__Any__Text a-b-c-Divider-w-x-y-z ---> a-b-c-Divider__w__x__y__z a-b-c-d-e-f-g-h-i-j ------> a-b-c-d-e-f-g-h-i-j (nothing replaced, since no Divider)