any-rule/js/app.dfb1a8cb.js
2019-06-28 11:17:42 +08:00

2 lines
12 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function(e){function t(t){for(var r,a,n=t[0],u=t[1],c=t[2],p=0,d=[];p<n.length;p++)a=n[p],l[a]&&d.push(l[a][0]),l[a]=0;for(r in u)Object.prototype.hasOwnProperty.call(u,r)&&(e[r]=u[r]);o&&o(t);while(d.length)d.shift()();return i.push.apply(i,c||[]),s()}function s(){for(var e,t=0;t<i.length;t++){for(var s=i[t],r=!0,n=1;n<s.length;n++){var u=s[n];0!==l[u]&&(r=!1)}r&&(i.splice(t--,1),e=a(a.s=s[0]))}return e}var r={},l={app:0},i=[];function a(t){if(r[t])return r[t].exports;var s=r[t]={i:t,l:!1,exports:{}};return e[t].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=e,a.c=r,a.d=function(e,t,s){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(a.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(s,r,function(t){return e[t]}.bind(null,r));return s},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/any-rule/";var n=window["webpackJsonp"]=window["webpackJsonp"]||[],u=n.push.bind(n);n.push=t,n=n.slice();for(var c=0;c<n.length;c++)t(n[c]);var o=u;i.push([0,"chunk-vendors"]),s()})({0:function(e,t,s){e.exports=s("56d7")},"46e9":function(e,t){e.exports=[{title:"URL正则",rule:/^((https?|ftp|file):\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/\w\.-]*)*\/?$/,example:"如: www.qq.com 、file:///C:/Users/KD/index.js"},{title:"手机号",rule:/^1((3[\d])|(4[5,6,9])|(5[0-3,5-9])|(6[5-7])|(7[0-8])|(8[1-3,5-8])|(9[1,8,9]))\d{8}$/,example:"如: 18311006933、17888829981"},{title:"大写字母",rule:/^[A-Z]+$/,example:"如: ABC、KD"},{title:"日期,如: 2000-01-01",rule:/^\d{4}(-)\d{1,2}\1\d{1,2}$/,example:"如: 1990-12-12、2020-01-01"},{title:"email地址",rule:/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,example:"如: 90203918@qq.com、nbilly@126.com"},{title:"国内座机电话,如: 0341-86091234",rule:/\d{3}-\d{8}|\d{4}-\d{7}/,example:"如: 0936-4211235"},{title:"身份证号(15位、18位数字)最后一位是校验位可能为数字或字符X",rule:/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,example:"如: 622223199912051311"},{title:"帐号是否合法(字母开头允许5-16字节允许字母数字下划线组合",rule:/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/,example:"如: justin、justin1989、justin_666"},{title:"只包含中文",rule:/^[\u4E00-\u9FA5]/,example:"如: 正则、前端"},{title:"是否小数",rule:/^\d+\.\d+$/,example:"如: 0.0、0.09"},{title:"是否电话格式(手机和座机)",rule:/^((0\d{2,3}-\d{7,8})|(1[345789]\d{9}))$/,example:"如: 0936-4211236、19888978261"},{title:"是否8位纯数字",rule:/^[0-9]{8}$/,example:"如: 12345678"},{title:"是否html标签",rule:/<(.*)>.*<\/\1>|<(.*) \/>/,example:"如: <div> </div>"},{title:"是否qq号格式正确",rule:/^[1-9][0-9]{4,10}$/,example:"如: 903013545、9020304"},{title:"是否由数字和字母组成",rule:/^[A-Za-z0-9]+$/,example:"如: james666、haha233hi"},{title:"是否小写字母组成",rule:/^[a-z]+$/,example:"如: russel"},{title:"密码强度正则最少6位包括至少1个大写字母1个小写字母1个数字1个特殊字符",rule:/^.*(?=.{6,})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/,example:"如: Kd@curry666"},{title:"用户名正则4到16位字母数字下划线减号",rule:/^[a-zA-Z0-9_-]{4,16}$/,example:"如: xiaohua_qq"},{title:"ipv4地址正则",rule:/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,example:"如: 172.16.0.0、127.0.0.0"},{title:"16进制颜色",rule:/^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/,example:"如: #f00 、#F90、#000、 #fe9de8"},{title:"微信号6至20位以字母开头字母数字减号下划线",rule:/^[a-zA-Z]([-_a-zA-Z0-9]{5,19})+$/,example:"如: github666、kd_-666"},{title:"车牌号正则",rule:/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9挂学警港澳]{1}$/,example:"如: 京A00599、黑D23908"},{title:"中国邮政编码",rule:/^(0[1-7]|1[0-356]|2[0-7]|3[0-6]|4[0-7]|5[1-7]|6[1-7]|7[0-5]|8[013-6])\d{4}$/,example:"如: 734500、100101"},{title:"只包含中文和数字",rule:/^(([\u4E00-\u9FA5])|(\d))+$/,example:"如: 哈哈哈、你好6啊"},{title:"非字母",rule:/[^A-Za-z]/,example:"如: 你好6啊、Q3Q、ABC@¥()"}]},"56d7":function(e,t,s){"use strict";s.r(t);s("dac5"),s("6e26"),s("9604"),s("df67");var r=s("6e6d"),l=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("main",[s("article",{staticClass:"fixed"},[s("a",{staticClass:"github",attrs:{onclick:"_hmt.push(['_trackEvent', '交互', '点击github', '悬浮'])",href:"https://github.com/any86/any-rule",target:"_blank"}},[s("svg",{attrs:{height:"20",viewBox:"0 0 16 16",version:"1.1",width:"20","aria-hidden":"true"}},[s("path",{attrs:{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"}})]),s("span",[e._v("github")])]),s("a",{staticClass:"message",attrs:{onclick:"_hmt.push(['_trackEvent', '交互', '留言'])",href:"https://github.com/any86/any-rule/issues/new",target:"_blank"}},[e._v("留言")])]),s("header",[s("h1",[e._v("正则大全")]),s("a",{staticClass:"github",staticStyle:{"margin-left":"15px",color:"#000"},attrs:{onclick:"_hmt.push(['_trackEvent', '交互', '点击github', '头部'])",href:"https://github.com/any86/any-rule",target:"_blank"}},[s("svg",{attrs:{height:"20",viewBox:"0 0 16 16",version:"1.1",width:"20","aria-hidden":"true"}},[s("path",{attrs:{"fill-rule":"evenodd",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"}})]),e._v("\n github\n ")]),s("input",{directives:[{name:"model",rawName:"v-model",value:e.keyword,expression:"keyword"}],ref:"searchInput",staticClass:"search-input",attrs:{autofocus:"",placeholder:"搜索关键词, 如'手机'",type:"text"},domProps:{value:e.keyword},on:{keyup:e.search,mouseenter:e.selectSearchInputText,focus:e.selectSearchInputText,input:function(t){t.target.composing||(e.keyword=t.target.value)}}})]),s("article",[0<e.rules.length?s("ul",{staticClass:"list"},e._l(e.rules,function(t,r){var l=t.title,i=t.rule,a=(t.events,t.example);return s("li",{key:l,staticClass:"row",on:{mouseenter:function(t){return e.mouseenterHandler(r)}}},[s("i",{staticClass:"border"}),s("h2",[e._v(e._s(l))]),s("p",{staticClass:"rule"},[s("span",{staticClass:"btn-copy",attrs:{"data-clipboard-text":i}},[e._v("点击复制")]),s("a",{staticClass:"btn-better",attrs:{href:"https://github.com/any86/any-rule/issues/new?title=我有更好的正则: "+l,target:"_blank"}},[e._v("我有不同意见")]),s("code",{ref:"code",refInFor:!0,staticClass:"javascript"},[e._v(e._s(i))])]),s("section",{staticClass:"verification"},[s("label",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.list[r].value,expression:"list[index].value"}],ref:"input",refInFor:!0,attrs:{placeholder:a},domProps:{value:e.list[r].value},on:{blur:function(t){return e.check(r,"blur")},keyup:function(t){return e.check(r,"keyup")},input:function(t){t.target.composing||e.$set(e.list[r],"value",t.target.value)}}}),s("span",{staticClass:"btn-clear",on:{click:function(t){return e.reset(r)}}},[e._v("清空")])]),s("div",{staticClass:"tip"},[void 0!==e.list[r].isOk?[e.list[r].isOk?s("p",{staticClass:"success"},[e._v("通过")]):s("p",{staticClass:"error"},[e._v("不通过")])]:e._e()],2)]),s("section",{staticClass:"trigger"},[s("h3",[e._v("验证时机")]),s("label",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.list[r].events.blur,expression:"list[index].events.blur"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.list[r].events.blur)?e._i(e.list[r].events.blur,null)>-1:e.list[r].events.blur},on:{change:function(t){var s=e.list[r].events.blur,l=t.target,i=!!l.checked;if(Array.isArray(s)){var a=null,n=e._i(s,a);l.checked?n<0&&e.$set(e.list[r].events,"blur",s.concat([a])):n>-1&&e.$set(e.list[r].events,"blur",s.slice(0,n).concat(s.slice(n+1)))}else e.$set(e.list[r].events,"blur",i)}}}),e._v(" blur\n ")]),s("label",[s("input",{directives:[{name:"model",rawName:"v-model",value:e.list[r].events.keyup,expression:"list[index].events.keyup"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.list[r].events.keyup)?e._i(e.list[r].events.keyup,null)>-1:e.list[r].events.keyup},on:{change:function(t){var s=e.list[r].events.keyup,l=t.target,i=!!l.checked;if(Array.isArray(s)){var a=null,n=e._i(s,a);l.checked?n<0&&e.$set(e.list[r].events,"keyup",s.concat([a])):n>-1&&e.$set(e.list[r].events,"keyup",s.slice(0,n).concat(s.slice(n+1)))}else e.$set(e.list[r].events,"keyup",i)}}}),e._v(" keyup\n ")])])])}),0):s("p",{attrs:{align:"center"}},[e._v("无数据")])])])},i=[],a=(s("bae3"),s("46e9")),n=s.n(a),u=s("7cbd"),c=s.n(u),o={name:"app",components:{},data:function(){return Object.freeze(n.a),{timer:null,keyword:"",rules:n.a,list:n.a.map(function(){return{value:"",isOk:void 0,events:{blur:!0,keyup:!0}}})}},mounted:function(){var e=new c.a(".btn-copy");this.$on("hook:destroyed",function(){e.destroy()});var t=null;e.on("success",function(e){clearTimeout(t);var s=e.trigger;s.classList.contains("success")&&s.classList.remove("success"),s.classList.add("success"),t=setTimeout(function(){s.classList.remove("success")},1e3)})},methods:{search:function(){var e=this;""!==this.keyword?this.rules=this.rules.filter(function(t){var s=t.title;return-1!==s.indexOf(e.keyword.toLowerCase())}):this.rules=n.a,_hmt.push(["_trackEvent","交互","搜索","关键词",this.keyword])},selectSearchInputText:function(){this.$refs.searchInput.select()},autoFocus:function(e){this.$refs.input[e].focus()},mouseenterHandler:function(e){},reset:function(e){var t=this;this.$nextTick(function(){t.list[e].value="",t.list[e].isOk=void 0})},check:function(e,t){var s=this.list[e],r=s.events,l=s.value;if(""===l&&this.reset(e),r[t]){var i=this.rules[e].rule,a=this.list[e];a.isOk=i.test(a.value)}"blur"===t&&_hmt.push(["_trackEvent","交互","input框",this.list[e].value])}}},p=o,d=(s("9b14"),s("17cc")),v=Object(d["a"])(p,l,i,!1,null,"947ae73a",null),h=v.exports;r["a"].config.productionTip=!1,new r["a"]({render:function(e){return e(h)}}).$mount("#app")},"9b14":function(e,t,s){"use strict";var r=s("e616"),l=s.n(r);l.a},e616:function(e,t,s){}});
//# sourceMappingURL=app.dfb1a8cb.js.map