REGEX - Allow Numbers and . - /

前端 未结 5 839
予麋鹿
予麋鹿 2021-01-13 19:10

I need a regular expression to allow just numeric and (.-/)

It should allow something like that:

011.235673.98923/0001-12

5条回答
  •  长情又很酷
    2021-01-13 19:38

    to be sure it's in right order and require every part

    ^(\d+)(\.(\d+))*(\/(\d+))*-(\d+)$
    

    edit: Forgot to add the / sry

提交回复
热议问题