{"id":245,"date":"2011-07-22T16:53:37","date_gmt":"2011-07-23T00:53:37","guid":{"rendered":"http:\/\/www.abin.cn\/?p=245"},"modified":"2012-01-29T06:01:06","modified_gmt":"2012-01-29T14:01:06","slug":"%e6%af%94%e8%be%83%e4%b8%8d%e9%94%99%e6%9c%89%e4%b8%ad%e6%96%87%e7%9a%84%e6%ad%a3%e5%88%99","status":"publish","type":"post","link":"https:\/\/www.abin.cn\/?p=245","title":{"rendered":"\u6bd4\u8f83\u4e0d\u9519,\u6709\u4e2d\u6587\u7684\u6b63\u5219."},"content":{"rendered":"<p>\/\/\u6b63\u5219\u5f0f\u7684\u4f7f\u7528<br \/>\nprivate bool SaveInfo(string ph1)<br \/>\n&nbsp; {<br \/>\n&nbsp; &nbsp;<br \/>\n&nbsp;&nbsp; string reg=@&quot;(86)*0*13\\d{9}&quot;;<br \/>\n&nbsp; &nbsp;<br \/>\n&nbsp;&nbsp; if(!Regex.Match(ph1,reg).Success)<br \/>\n&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp; throw new Class1(&quot;\u683c\u5f0f\u9519\u8bef!&quot;);<br \/>\n&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp; return true;<br \/>\n&nbsp; }<br \/>\n<!--more--><br \/>\n&nbsp; private void button1_Click(object sender, System.EventArgs e)<br \/>\n&nbsp; {<br \/>\n&nbsp;&nbsp; try<br \/>\n&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp; SaveInfo(&quot;+860&quot;+textBox1.Text);<br \/>\n&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp; catch(Class1 ex)<br \/>\n&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp; MessageBox.Show(ex.Message);<br \/>\n&nbsp;&nbsp;&nbsp; return;<br \/>\n&nbsp;&nbsp; }<br \/>\n&nbsp;&nbsp; MessageBox.Show(&quot;\u6210\u529f,\u4f60\u7684\u624b\u673a\u53f7\u662f\uff1a\\n +860&quot;+textBox1.Text); &nbsp;<br \/>\n&nbsp; }<\/p>\n<p>\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u7f51\u7edc\u94fe\u63a5:<br \/>\n(h|H)(r|R)(e|E)(f|F) *= *(&#8216;|&quot;)?(\\w|\\\\|\\\/|\\.)+(&#8216;|&quot;| *|&gt;)?<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u90ae\u4ef6\u5730\u5740:<br \/>\n\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u56fe\u7247\u94fe\u63a5:<br \/>\n(s|S)(r|R)(c|C) *= *(&#8216;|&quot;)?(\\w|\\\\|\\\/|\\.)+(&#8216;|&quot;| *|&gt;)?<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684ip\u5730\u5740:<br \/>\n(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u4e2d\u56fd\u624b\u673a\u53f7\u7801:<br \/>\n(86)*0*13\\d{9}<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u4e2d\u56fd\u56fa\u5b9a\u7535\u8bdd\u53f7\u7801:<br \/>\n(\\(\\d{3,4}\\)|\\d{3,4}-|\\s)?\\d{8}<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u4e2d\u56fd\u7535\u8bdd\u53f7\u7801\uff08\u5305\u62ec\u79fb\u52a8\u548c\u56fa\u5b9a\u7535\u8bdd\uff09:<br \/>\n(\\(\\d{3,4}\\)|\\d{3,4}-|\\s)?\\d{7,14}<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u4e2d\u56fd\u90ae\u653f\u7f16\u7801:<br \/>\n[1-9]{1}(\\d+){5}<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u4e2d\u56fd\u8eab\u4efd\u8bc1\u53f7\u7801:<br \/>\n\\d{18}|\\d{15}<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u6574\u6570\uff1a<br \/>\n\\d+<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u6d6e\u70b9\u6570\uff08\u5373\u5c0f\u6570\uff09\uff1a<br \/>\n(-?\\d*)\\.?\\d+<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u4efb\u4f55\u6570\u5b57 \uff1a<br \/>\n(-?\\d*)(\\.\\d+)?<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u4e2d\u6587\u5b57\u7b26\u4e32\uff1a<br \/>\n[\\u4e00-\\u9fa5]*<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u53cc\u5b57\u8282\u5b57\u7b26\u4e32 (\u6c49\u5b57)\uff1a<br \/>\n[^\\x00-\\xff]*<\/p>\n<p>\u63d0\u53d6\u4fe1\u606f\u4e2d\u7684\u82f1\u6587\u5b57\u7b26\u4e32\uff1a<br \/>\n\\w*<\/p>\n<p>&nbsp;<\/p>\n<p>==================================================<\/p>\n<p>\n\u5339\u914d\u4e2d\u6587\u5b57\u7b26\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a [\\u4e00-\\u9fa5]<\/p>\n<p>\u5339\u914d\u53cc\u5b57\u8282\u5b57\u7b26(\u5305\u62ec\u6c49\u5b57\u5728\u5185)\uff1a[^\\x00-\\xff]<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u7528\u4e8e\u5b57\u7b26\u4e32\u5904\u7406\u3001\u8868\u5355\u9a8c\u8bc1\u7b49\u573a\u5408\uff0c\u5b9e\u7528\u9ad8\u6548\u3002\u73b0\u5c06\u4e00\u4e9b\u5e38\u7528\u7684\u8868\u8fbe\u5f0f\u6536\u96c6\u4e8e\u6b64\uff0c\u4ee5\u5907\u4e0d\u65f6\u4e4b\u9700\u3002<\/p>\n<p>\n\u5339\u914d\u4e2d\u6587\u5b57\u7b26\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a [\\u4e00-\\u9fa5]<br \/>\n\u8bc4\u6ce8\uff1a\u5339\u914d\u4e2d\u6587\u8fd8\u771f\u662f\u4e2a\u5934\u75bc\u7684\u4e8b\uff0c\u6709\u4e86\u8fd9\u4e2a\u8868\u8fbe\u5f0f\u5c31\u597d\u529e\u4e86<\/p>\n<p>\u5339\u914d\u53cc\u5b57\u8282\u5b57\u7b26(\u5305\u62ec\u6c49\u5b57\u5728\u5185)\uff1a[^\\x00-\\xff]<br \/>\n\u8bc4\u6ce8\uff1a\u53ef\u4ee5\u7528\u6765\u8ba1\u7b97\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\uff08\u4e00\u4e2a\u53cc\u5b57\u8282\u5b57\u7b26\u957f\u5ea6\u8ba12\uff0cASCII\u5b57\u7b26\u8ba11\uff09<\/p>\n<p>\u5339\u914d\u7a7a\u767d\u884c\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a\\n\\s*\\r<br \/>\n\u8bc4\u6ce8\uff1a\u53ef\u4ee5\u7528\u6765\u5220\u9664\u7a7a\u767d\u884c<\/p>\n<p>\u5339\u914dHTML\u6807\u8bb0\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a&lt;(\\S*?)[^&gt;]*&gt;.*?&lt;\/\\1&gt;|&lt;.*? \/&gt;<br \/>\n\u8bc4\u6ce8\uff1a\u7f51\u4e0a\u6d41\u4f20\u7684\u7248\u672c\u592a\u7cdf\u7cd5\uff0c\u4e0a\u9762\u8fd9\u4e2a\u4e5f\u4ec5\u4ec5\u80fd\u5339\u914d\u90e8\u5206\uff0c\u5bf9\u4e8e\u590d\u6742\u7684\u5d4c\u5957\u6807\u8bb0\u4f9d\u65e7\u65e0\u80fd\u4e3a\u529b<\/p>\n<p>\u5339\u914d\u9996\u5c3e\u7a7a\u767d\u5b57\u7b26\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a^\\s*|\\s*$<br \/>\n\u8bc4\u6ce8\uff1a\u53ef\u4ee5\u7528\u6765\u5220\u9664\u884c\u9996\u884c\u5c3e\u7684\u7a7a\u767d\u5b57\u7b26(\u5305\u62ec\u7a7a\u683c\u3001\u5236\u8868\u7b26\u3001\u6362\u9875\u7b26\u7b49\u7b49)\uff0c\u975e\u5e38\u6709\u7528\u7684\u8868\u8fbe\u5f0f<\/p>\n<p>\u5339\u914dEmail\u5730\u5740\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*<br \/>\n\u8bc4\u6ce8\uff1a\u8868\u5355\u9a8c\u8bc1\u65f6\u5f88\u5b9e\u7528<\/p>\n<p>\u5339\u914d\u7f51\u5740URL\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a[a-zA-z]+:\/\/[^\\s]*<br \/>\n\u8bc4\u6ce8\uff1a\u7f51\u4e0a\u6d41\u4f20\u7684\u7248\u672c\u529f\u80fd\u5f88\u6709\u9650\uff0c\u4e0a\u9762\u8fd9\u4e2a\u57fa\u672c\u53ef\u4ee5\u6ee1\u8db3\u9700\u6c42<\/p>\n<p>\u5339\u914d\u5e10\u53f7\u662f\u5426\u5408\u6cd5(\u5b57\u6bcd\u5f00\u5934\uff0c\u5141\u8bb85-16\u5b57\u8282\uff0c\u5141\u8bb8\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf)\uff1a^[a-zA-Z][a-zA-Z0-9_]{4,15}$<br \/>\n\u8bc4\u6ce8\uff1a\u8868\u5355\u9a8c\u8bc1\u65f6\u5f88\u5b9e\u7528<\/p>\n<p>\u5339\u914d\u56fd\u5185\u7535\u8bdd\u53f7\u7801\uff1a\\d{3}-\\d{8}|\\d{4}-\\d{7}<br \/>\n\u8bc4\u6ce8\uff1a\u5339\u914d\u5f62\u5f0f\u5982 0511-4405222 \u6216 021-87888822<\/p>\n<p>\u5339\u914d\u817e\u8bafQQ\u53f7\uff1a[1-9][0-9]{4,}<br \/>\n\u8bc4\u6ce8\uff1a\u817e\u8bafQQ\u53f7\u4ece10000\u5f00\u59cb<\/p>\n<p>\u5339\u914d\u4e2d\u56fd\u90ae\u653f\u7f16\u7801\uff1a[1-9]\\d{5}(?!\\d)<br \/>\n\u8bc4\u6ce8\uff1a\u4e2d\u56fd\u90ae\u653f\u7f16\u7801\u4e3a6\u4f4d\u6570\u5b57<\/p>\n<p>\u5339\u914d\u8eab\u4efd\u8bc1\uff1a\\d{15}|\\d{18}<br \/>\n\u8bc4\u6ce8\uff1a\u4e2d\u56fd\u7684\u8eab\u4efd\u8bc1\u4e3a15\u4f4d\u621618\u4f4d<\/p>\n<p>\u5339\u914dip\u5730\u5740\uff1a\\d+\\.\\d+\\.\\d+\\.\\d+<br \/>\n\u8bc4\u6ce8\uff1a\u63d0\u53d6ip\u5730\u5740\u65f6\u6709\u7528<\/p>\n<p>\u5339\u914d\u7279\u5b9a\u6570\u5b57\uff1a<br \/>\n^[1-9]\\d*$ \/\/\u5339\u914d\u6b63\u6574\u6570<br \/>\n^-[1-9]\\d*$ \/\/\u5339\u914d\u8d1f\u6574\u6570<br \/>\n^-?[1-9]\\d*$ \/\/\u5339\u914d\u6574\u6570<br \/>\n^[1-9]\\d*|0$ \/\/\u5339\u914d\u975e\u8d1f\u6574\u6570\uff08\u6b63\u6574\u6570 + 0\uff09<br \/>\n^-[1-9]\\d*|0$ \/\/\u5339\u914d\u975e\u6b63\u6574\u6570\uff08\u8d1f\u6574\u6570 + 0\uff09<br \/>\n^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$ \/\/\u5339\u914d\u6b63\u6d6e\u70b9\u6570<br \/>\n^-([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*)$ \/\/\u5339\u914d\u8d1f\u6d6e\u70b9\u6570<br \/>\n^-?([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0)$ \/\/\u5339\u914d\u6d6e\u70b9\u6570<br \/>\n^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0$ \/\/\u5339\u914d\u975e\u8d1f\u6d6e\u70b9\u6570\uff08\u6b63\u6d6e\u70b9\u6570 + 0\uff09<br \/>\n^(-([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*))|0?\\.0+|0$ \/\/\u5339\u914d\u975e\u6b63\u6d6e\u70b9\u6570\uff08\u8d1f\u6d6e\u70b9\u6570 + 0\uff09<br \/>\n\u8bc4\u6ce8\uff1a\u5904\u7406\u5927\u91cf\u6570\u636e\u65f6\u6709\u7528\uff0c\u5177\u4f53\u5e94\u7528\u65f6\u6ce8\u610f\u4fee\u6b63<\/p>\n<p>\u5339\u914d\u7279\u5b9a\u5b57\u7b26\u4e32\uff1a<br \/>\n^[A-Za-z]+$ \/\/\u5339\u914d\u753126\u4e2a\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<br \/>\n^[A-Z]+$ \/\/\u5339\u914d\u753126\u4e2a\u82f1\u6587\u5b57\u6bcd\u7684\u5927\u5199\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<br \/>\n^[a-z]+$ \/\/\u5339\u914d\u753126\u4e2a\u82f1\u6587\u5b57\u6bcd\u7684\u5c0f\u5199\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<br \/>\n^[A-Za-z0-9]+$ \/\/\u5339\u914d\u7531\u6570\u5b57\u548c26\u4e2a\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<br \/>\n^\\w+$ \/\/\u5339\u914d\u7531\u6570\u5b57\u300126\u4e2a\u82f1\u6587\u5b57\u6bcd\u6216\u8005\u4e0b\u5212\u7ebf\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<br \/>\n\u8bc4\u6ce8\uff1a\u6700\u57fa\u672c\u4e5f\u662f\u6700\u5e38\u7528\u7684\u4e00\u4e9b\u8868\u8fbe<\/p>\n<p>&nbsp;<\/p>\n<p>\n==================================================<\/p>\n<p>\n\u5339\u914d\u4e2d\u6587\u5b57\u7b26\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a [\\u4e00-\\u9fa5]<\/p>\n<p>\u5339\u914d\u53cc\u5b57\u8282\u5b57\u7b26(\u5305\u62ec\u6c49\u5b57\u5728\u5185)\uff1a[^\\x00-\\xff]<\/p>\n<p>\n\u5339\u914dEmail\u5730\u5740\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1a\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*<\/p>\n<p>\u5339\u914d\u7f51\u5740URL\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff1ahttp:\/\/([\\w-]+\\.)+[\\w-]+(\/[\\w- .\/?%&amp;=]*)?<\/p>\n<p>\u5229\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9650\u5236\u7f51\u9875\u8868\u5355\u91cc\u7684\u6587\u672c\u6846\u8f93\u5165\u5185\u5bb9\uff1a<\/p>\n<p>\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9650\u5236\u53ea\u80fd\u8f93\u5165\u4e2d\u6587\uff1aonkeyup=&quot;value=&quot;\/oblog4\/value.replace(\/[&quot;^\\u4E00- \\u9FA5]\/g,)&quot; onbeforepaste=&quot;clipboardData.setData(text,clipboardData.getData(text).replace(\/[^\\u4E00-\\u9FA5]\/g,))&quot;<\/p>\n<p>\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9650\u5236\u53ea\u80fd\u8f93\u5165\u5168\u89d2\u5b57\u7b26\uff1a onkeyup=&quot;value=&quot;\/oblog4\/value.replace(\/[&quot;^\\uFF00-\\uFFFF]\/g,)&quot; onbeforepaste=&quot;clipboardData.setData(text,clipboardData.getData(text).replace(\/[^\\uFF00-\\uFFFF]\/g,))&quot;<\/p>\n<p>\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9650\u5236\u53ea\u80fd\u8f93\u5165\u6570\u5b57\uff1aonkeyup=&quot;value=&quot;\/oblog4\/value.replace(\/[&quot;^\\d]\/g,) &quot;onbeforepaste=&quot;clipboardData.setData(text,clipboardData.getData(text).replace(\/[^\\d]\/g,))&quot;<\/p>\n<p>\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u9650\u5236\u53ea\u80fd\u8f93\u5165\u6570\u5b57\u548c\u82f1\u6587\uff1aonkeyup=&quot;value=&quot;\/oblog4\/value.replace(\/[\\W]\/g,)&quot; &quot;onbeforepaste=&quot;clipboardData.setData(text,clipboardData.getData(text).replace(\/[^\\d]\/g,))&quot;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/\/\u6b63\u5219\u5f0f\u7684\u4f7f\u7528 private bool SaveInfo(string ph1) &nbsp; { &#038;nb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[63,64,62],"_links":{"self":[{"href":"https:\/\/www.abin.cn\/index.php?rest_route=\/wp\/v2\/posts\/245"}],"collection":[{"href":"https:\/\/www.abin.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.abin.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.abin.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.abin.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=245"}],"version-history":[{"count":0,"href":"https:\/\/www.abin.cn\/index.php?rest_route=\/wp\/v2\/posts\/245\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.abin.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=245"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.abin.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=245"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.abin.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}