代码如下:

点击查看代码
let mobile = /(?:^1[3456789]|^9[289]|^6[12456789])\d{9}$/
    let phone = /^[0]?\d{2,3}[- ]?\d{7,8}/
    let telephone =
      /^[0]?\d{2,3}[- ]?\d{7,8}$|(?:^1[3456789]|^9[289]|^6[12456789])\d{9}$/
    let url =
      /^((?:http)?\/\/www\.|(?:https:)?\/\/www\.|(?:http:)?\/\/|(?:https:)?\/\/)?[a-z0-9]+([-.]{1}[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$)/
    let int = /^[1-9]\d*$/
    let float = /^(\d*[.])?\d+$/
    let natural = /^[1-9]\d*$|^0$/
    let price = /^([1-9]\d*|0)(\.\d{1,2})?$/
    let discount = /^\d(\.\d)?$/
posted on 2022-12-02 18:01  好久不见-库克  阅读(44)  评论(0)    收藏  举报