{"id":75,"date":"2021-10-01T00:24:41","date_gmt":"2021-09-30T16:24:41","guid":{"rendered":"https:\/\/www.tysql.com\/?p=75"},"modified":"2021-10-01T00:24:41","modified_gmt":"2021-09-30T16:24:41","slug":"javascript-%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.tysql.com\/index.php\/2021\/10\/01\/javascript-%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f\/","title":{"rendered":"JavaScript \u6b63\u5219\u8868\u8fbe\u5f0f"},"content":{"rendered":"\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:false,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;darcula&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">\/*\u662f\u5426\u5e26\u6709\u5c0f\u6570*\/\nfunction    isDecimal(strValue )  {  \n   var  objRegExp= \/^\\d+\\.\\d+$\/;\n   return  objRegExp.test(strValue);  \n}  \n\n\/*\u6821\u9a8c\u662f\u5426\u4e2d\u6587\u540d\u79f0\u7ec4\u6210 *\/\nfunction ischina(str) {\n    var reg=\/^[\\u4E00-\\u9FA5]{2,4}$\/;   \/*\u5b9a\u4e49\u9a8c\u8bc1\u8868\u8fbe\u5f0f*\/\n    return reg.test(str);     \/*\u8fdb\u884c\u9a8c\u8bc1*\/\n}\n\n\/*\u6821\u9a8c\u662f\u5426\u5168\u75318\u4f4d\u6570\u5b57\u7ec4\u6210 *\/\nfunction isStudentNo(str) {\n    var reg=\/^[0-9]{8}$\/;   \/*\u5b9a\u4e49\u9a8c\u8bc1\u8868\u8fbe\u5f0f*\/\n    return reg.test(str);     \/*\u8fdb\u884c\u9a8c\u8bc1*\/\n}\n\n\/*\u6821\u9a8c\u7535\u8bdd\u7801\u683c\u5f0f *\/\nfunction isTelCode(str) {\n    var reg= \/^((0\\d{2,3}-\\d{7,8})|(1[3584]\\d{9}))$\/;\n    return reg.test(str);\n}\n\n\/*\u6821\u9a8c\u90ae\u4ef6\u5730\u5740\u662f\u5426\u5408\u6cd5 *\/\nfunction IsEmail(str) {\n    var reg=\/^\\w+@[a-zA-Z0-9]{2,10}(?:\\.[a-z]{2,4}){1,3}$\/;\n    return reg.test(str);\n}<\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,4],"tags":[],"class_list":["post-75","post","type-post","status-publish","format-standard","hentry","category-javascript","category-qianduan"],"_links":{"self":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts\/75","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/comments?post=75"}],"version-history":[{"count":1,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts\/75\/revisions"}],"predecessor-version":[{"id":76,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/posts\/75\/revisions\/76"}],"wp:attachment":[{"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/media?parent=75"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/categories?post=75"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tysql.com\/index.php\/wp-json\/wp\/v2\/tags?post=75"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}