Put the -
symbol at the first or at the last inside char class Otherwise, it takes the range from space to the /
(forward slash.) . )
symbol also falls in that range so that it matches )
.
([- /_]+)$
-
inside character class acts as a range operator only if it's not at the first or at the last or not escaped.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…