📌  相关文章
📜  正则表达式仅出现一次字符 - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:16.445000             🧑  作者: Mango

代码示例1
You can do this

/^[^-]+-[^-]+$/
^ depicts the start of the string

$ depicts the end of the string

[^-]+ matches 1 to many characters except -