How to match hyphens with Regular Expression?

后端 未结 6 1138
[愿得一人]
[愿得一人] 2020-11-21 23:36

How to rewrite the [a-zA-Z0-9!$* \\t\\r\\n] pattern to match hyphen along with the existing characters ?

6条回答
  •  無奈伤痛
    2020-11-21 23:56

    [-a-z0-9]+,[a-z0-9-]+,[a-z-0-9]+ and also [a-z-0-9]+ all are same.The hyphen between two ranges considered as a symbol.And also [a-z0-9-+()]+ this regex allow hyphen.

提交回复
热议问题