Regex應用,Regex

來源:互聯網
上載者:User

Regex應用,Regex

 1 decma: "^([+-]?)\\d*\\.\\d+$", //浮點數   2 decma1: "^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*$", //正浮點數   3 decma2: "^-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*)$", //負浮點數   4 decma3: "^-?([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0)$", //浮點數   5 decma4: "^[1-9]\\d*.\\d*|0.\\d*[1-9]\\d*|0?.0+|0$", //非負浮點數(正浮點數 + 0)   6 decma6: "^(-([1-9]\\d*.\\d*|0.\\d*[1-9]\\d*))|0?.0+|0$", //非正浮點數(負浮點數 + 0)  7 intege: "^-?[1-9]\\d*$", //整數 8 intege1: "^[1-9]\\d*$", //正整數  9 intege2: "^-[1-9]\\d*$", //負整數  10 num: "^([+-]?)\\d*\\.?\\d+$", //數字  11 num1: "^[1-9]\\d*|0$", //正數(正整數 + 0)  12 num2: "^-[1-9]\\d*|0$", //負數(負整數 + 0)  13 ascii: "^[\\x00-\\xFF]+$", //僅ACSII字元  14 chinese: "^[\\u4e00-\\u9fa5]+$", //僅中文 15 color: "^[a-fA-F0-9]{6}$", //顏色  16 date: "^\\d{4}(\\-|\\/|\.)\\d{1,2}\\1\\d{1,2}$", //日期  17 email: "^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$", //郵件  18 idcard: "^[1-9]([0-9]{14}|[0-9]{17})$", //身份證  19 ip4: "^(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)\\.(25[0-5]|2[0-4]\\d|[0-1]\\d{2}|[1-9]?\\d)$", //ip地址  20 letter: "^[A-Za-z]+$", //字母  letter_l: "^[a-z]+$", //小寫字母 21 letter_u: "^[A-Z]+$", //大寫字母  22 mobile: "^0?(13|15|17|18|14)[0-9]{9}$", //手機  23 notempty: "^\\S+$", //非空 24 password: "^.*[A-Za-z0-9\\w_-]+.*$", //密碼  25 fullNumber: "^[0-9]+$", //數字  26 picture: "(.*)\\.(jpg|bmp|gif|ico|pcx|jpeg|tif|png|raw|tga)$", //圖片  27 qq: "^[1-9]*[1-9][0-9]*$", //QQ號碼  28 rar: "(.*)\\.(rar|zip|7zip|tgz)$", //壓縮檔  29 tel: "^[0-9\-()()]{7,18}$", //電話號碼的函數(包括驗證國內區號,國際區號,分機號)  30 url: "^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&=]*)?$", //url  31 username: "^[A-Za-z0-9_\\-\\u4e00-\\u9fa5]+$", //使用者名稱  32 deptname: "^[A-Za-z0-9_()()\\-\\u4e00-\\u9fa5]+$", //單位名 33 zipcode: "^\\d{6}$", //郵編  realname: "^[A-Za-z\\u4e00-\\u9fa5]+$", // 真實姓名  34 ompanyname: "^[A-Za-z0-9_()()\\-\\u4e00-\\u9fa5]+$",//公司名稱35 ompanyaddr: "^[A-Za-z0-9_()()\\#\\-\\u4e00-\\u9fa5]+$", //公司地址 36 ompanysite: "^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&#=]*)?$",//公司網站

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.