{"id":619,"date":"2021-04-09T13:26:18","date_gmt":"2021-04-09T05:26:18","guid":{"rendered":"http:\/\/bj.iur.me\/?p=619"},"modified":"2022-11-07T00:03:47","modified_gmt":"2022-11-06T16:03:47","slug":"%e5%b8%b8%e7%94%a8%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.iur.me\/?p=619","title":{"rendered":"\u5e38\u7528\u6b63\u5219\u8868\u8fbe\u5f0f"},"content":{"rendered":"\n<p id=\"meta\">\u7248\u672c\uff1av0.03 (2013-5-13) \u6574\u7406\uff1adeerchao<\/p>\n\n\n\n<p>\u8bf4\u660e\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f\u901a\u5e38\u7528\u4e8e\u4e24\u79cd\u4efb\u52a1\uff1a1.\u9a8c\u8bc1\uff0c2.\u641c\u7d22\/\u66ff\u6362\u3002\u7528\u4e8e\u9a8c\u8bc1\u65f6\uff0c\u901a\u5e38\u9700\u8981\u5728\u524d\u540e\u5206\u522b\u52a0\u4e0a^\u548c$\uff0c\u4ee5\u5339\u914d\u6574\u4e2a\u5f85\u9a8c\u8bc1\u5b57\u7b26\u4e32\uff1b\u641c\u7d22\/\u66ff\u6362\u65f6\u662f\u5426\u52a0\u4e0a\u6b64\u9650\u5b9a\u5219\u6839\u636e\u641c\u7d22\u7684\u8981\u6c42\u800c\u5b9a\uff0c\u6b64\u5916\uff0c\u4e5f\u6709\u53ef\u80fd\u8981\u5728\u524d\u540e\u52a0\u4e0a\\b\u800c\u4e0d\u662f^\u548c$\u3002\u6b64\u8868\u6240\u5217\u7684\u5e38\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u9664\u4e2a\u522b\u5916\u5747\u672a\u5728\u524d\u540e\u52a0\u4e0a\u4efb\u4f55\u9650\u5b9a\uff0c\u8bf7\u6839\u636e\u9700\u8981\uff0c\u81ea\u884c\u5904\u7406\u3002<\/p>\n\n\n\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\uff08\u82f1\u6587\uff1aRegular Expression\uff09\u5728\u8ba1\u7b97\u673a\u79d1\u5b66\u4e2d\uff0c\u662f\u6307\u4e00\u4e2a\u7528\u6765\u63cf\u8ff0\u6216\u8005\u5339\u914d\u4e00\u7cfb\u5217\u7b26\u5408\u67d0\u4e2a\u53e5\u6cd5\u89c4\u5219\u7684\u5b57\u7b26\u4e32\u7684\u5355\u4e2a\u5b57\u7b26\u4e32\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u8bf4\u660e<\/th><th>\u6b63\u5219\u8868\u8fbe\u5f0f<\/th><\/tr><\/thead><tbody><tr><td>\u7f51\u5740\uff08URL\uff09<\/td><td>[a-zA-z]+:\/\/[^\\s]*<\/td><\/tr><tr><td>IP\u5730\u5740(IP Address)<\/td><td>((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)<\/td><\/tr><tr><td>\u7535\u5b50\u90ae\u4ef6(Email)<\/td><td>\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*<\/td><\/tr><tr><td>QQ\u53f7\u7801<\/td><td>[1-9]\\d{4,}<\/td><\/tr><tr><td>HTML\u6807\u8bb0(\u5305\u542b\u5185\u5bb9\u6216\u81ea\u95ed\u5408)<\/td><td>&lt;(.*)(.*)&gt;.*&lt;\\\/\\1&gt;|&lt;(.*) \\\/&gt;<\/td><\/tr><tr><td>\u5bc6\u7801(\u7531\u6570\u5b57\/\u5927\u5199\u5b57\u6bcd\/\u5c0f\u5199\u5b57\u6bcd\/\u6807\u70b9\u7b26\u53f7\u7ec4\u6210\uff0c\u56db\u79cd\u90fd\u5fc5\u6709\uff0c8\u4f4d\u4ee5\u4e0a)<\/td><td>(?=^.{8,}$)(?=.*\\d)(?=.*\\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\\n).*$<\/td><\/tr><tr><td>\u65e5\u671f(\u5e74-\u6708-\u65e5)<\/td><td>(\\d{4}|\\d{2})-((1[0-2])|(0?[1-9]))-(([12][0-9])|(3[01])|(0?[1-9]))<\/td><\/tr><tr><td>\u65e5\u671f(\u6708\/\u65e5\/\u5e74)<\/td><td>((1[0-2])|(0?[1-9]))\/(([12][0-9])|(3[01])|(0?[1-9]))\/(\\d{4}|\\d{2})<\/td><\/tr><tr><td>\u65f6\u95f4(\u5c0f\u65f6:\u5206\u949f, 24\u5c0f\u65f6\u5236)<\/td><td>((1|0?)[0-9]|2[0-3]):([0-5][0-9])<\/td><\/tr><tr><td>\u6c49\u5b57(\u5b57\u7b26)<\/td><td>[\\u4e00-\\u9fa5]<\/td><\/tr><tr><td>\u4e2d\u6587\u53ca\u5168\u89d2\u6807\u70b9\u7b26\u53f7(\u5b57\u7b26)<\/td><td>[\\u3000-\\u301e\\ufe10-\\ufe19\\ufe30-\\ufe44\\ufe50-\\ufe6b\\uff01-\\uffee]<\/td><\/tr><tr><td>\u4e2d\u56fd\u5927\u9646\u56fa\u5b9a\u7535\u8bdd\u53f7\u7801<\/td><td>(\\d{4}-|\\d{3}-)?(\\d{8}|\\d{7})<\/td><\/tr><tr><td>\u4e2d\u56fd\u5927\u9646\u624b\u673a\u53f7\u7801<\/td><td>1\\d{10}<\/td><\/tr><tr><td>\u4e2d\u56fd\u5927\u9646\u90ae\u653f\u7f16\u7801<\/td><td>[1-9]\\d{5}<\/td><\/tr><tr><td>\u4e2d\u56fd\u5927\u9646\u8eab\u4efd\u8bc1\u53f7(15\u4f4d\u621618\u4f4d)<\/td><td>\\d{15}(\\d\\d[0-9xX])?<\/td><\/tr><tr><td>\u975e\u8d1f\u6574\u6570(\u6b63\u6574\u6570\u6216\u96f6)<\/td><td>\\d+<\/td><\/tr><tr><td>\u6b63\u6574\u6570<\/td><td>[0-9]*[1-9][0-9]*<\/td><\/tr><tr><td>\u8d1f\u6574\u6570<\/td><td>-[0-9]*[1-9][0-9]*<\/td><\/tr><tr><td>\u6574\u6570<\/td><td>-?\\d+<\/td><\/tr><tr><td>\u5c0f\u6570<\/td><td>(-?\\d+)(\\.\\d+)?<\/td><\/tr><tr><td>\u4e0d\u5305\u542babc\u7684\u5355\u8bcd<\/td><td>\\b((?!abc)\\w)+\\b<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4ee5\u4e0a\u6b63\u5219\u8868\u8fbe\u5f0f\u5747\u7ecf\u8fc7\u591a\u6b21\u6d4b\u8bd5\uff0c\u5e76\u4e0d\u65ad\u589e\u52a0,\u56e0\u4e3a\u4e0d\u540c\u7a0b\u5e8f\u6216\u5de5\u5177\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u7565\u6709\u533a\u522b\uff0c\u5927\u5bb6\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u7b80\u5355\u4fee\u6539<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5e38\u7528\u6b63\u5219\u8868\u8fbe\u8865\u5145<\/h2>\n\n\n\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\u4e0b\u9762\u90fd\u662f\u4e00\u4e9b\u57fa\u672c\u7684\u89c4\u5219\uff0c\u66f4\u65b0\u4e0e\u8981\u6c42\u66f4\u9ad8\u7684\u53ef\u4ee5\u53c2\u8003\u8fd9\u7bc7\u6587\u7ae0\u3002<br><a href=\"https:\/\/www.jb51.net\/article\/115170.htm\" target=\"_blank\" rel=\"noreferrer noopener\">\u7528\u6237\u540d\u3001\u5bc6\u7801\u7b4915\u4e2a\u5e38\u7528\u7684js\u6b63\u5219\u8868\u8fbe\u5f0f<\/a><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u8bf4\u660e<\/th><th>\u6b63\u5219\u8868\u8fbe\u5f0f<\/th><\/tr><\/thead><tbody><tr><td>\u7528\u6237<\/td><td>\/^[a-z0-9_-]{3,16}$\/<\/td><\/tr><tr><td>\u5bc6\u7801<\/td><td>\/^[a-z0-9_-]{6,18}$\/<\/td><\/tr><tr><td>\u5341\u516d\u8fdb\u5236\u503c<\/td><td>\/^#?([a-f0-9]{6}|[a-f0-9]{3})$\/<\/td><\/tr><tr><td>\u7535\u5b50\u90ae\u7bb1<\/td><td>\/^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$\/<\/td><\/tr><tr><td>URL<\/td><td>\/^(https?:\\\/\\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\\/\\w \\.-]*)*\\\/?$\/<\/td><\/tr><tr><td>IP \u5730\u5740<\/td><td>\/^(?:(?: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]?)$\/<\/td><\/tr><tr><td>HTML \u6807\u7b7e<\/td><td>\/^&lt;([a-z]+)([^&lt;]+)*(?:&gt;(.*)&lt;\\\/\\1&gt;|\\s+\\\/&gt;)$\/<\/td><\/tr><tr><td>Unicode\u7f16\u7801\u4e2d\u7684\u6c49\u5b57\u8303\u56f4<\/td><td>\/^[u4e00-u9fa5],{0,}$\/<\/td><\/tr><tr><td>\u5339\u914d\u4e2d\u6587\u5b57\u7b26\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/td><td>[\\u4e00-\\u9fa5]<\/td><\/tr><tr><td><strong>\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<\/strong><\/td><\/tr><tr><td>\u5339\u914d\u53cc\u5b57\u8282\u5b57\u7b26(\u5305\u62ec\u6c49\u5b57\u5728\u5185)<\/td><td>[^\\x00-\\xff]<\/td><\/tr><tr><td><strong>\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<\/strong><\/td><\/tr><tr><td>\u5339\u914d\u7a7a\u767d\u884c\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/td><td>\\n\\s*\\r<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u53ef\u4ee5\u7528\u6765\u5220\u9664\u7a7a\u767d\u884c<\/strong><\/td><\/tr><tr><td>\u5339\u914dHTML\u6807\u8bb0\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/td><td>&lt;(\\S*?)[^&gt;]*&gt;.*?&lt;\/\\1&gt;|&lt;.*? \/&gt;<\/td><\/tr><tr><td>\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<\/td><\/tr><tr><td>\u5339\u914d\u9996\u5c3e\u7a7a\u767d\u5b57\u7b26\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/td><td>^\\s*|\\s*$<\/td><\/tr><tr><td><strong>\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<\/strong><\/td><\/tr><tr><td>\u5339\u914dEmail\u5730\u5740\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/td><td>\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u8868\u5355\u9a8c\u8bc1\u65f6\u5f88\u5b9e\u7528<\/strong><\/td><\/tr><tr><td>\u5339\u914d\u7f51\u5740URL\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/td><td>[a-zA-z]+:\/\/[^\\s]*<\/td><\/tr><tr><td><strong>\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<\/strong><\/td><\/tr><tr><td>\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)<\/td><td>^[a-zA-Z][a-zA-Z0-9_]{4,15}$<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u8868\u5355\u9a8c\u8bc1\u65f6\u5f88\u5b9e\u7528<\/strong><\/td><\/tr><tr><td>\u5339\u914d\u56fd\u5185\u7535\u8bdd\u53f7\u7801<\/td><td>\\d{3}-\\d{8}|\\d{4}-\\d{7}<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u5339\u914d\u5f62\u5f0f\u5982 0511-4405222 \u6216 021-87888822<\/strong><\/td><\/tr><tr><td>\u5339\u914d\u817e\u8bafQQ\u53f7<\/td><td>[1-9][0-9]{4,}<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u817e\u8bafQQ\u53f7\u4ece10000\u5f00\u59cb<\/strong><\/td><\/tr><tr><td>\u5339\u914d\u4e2d\u56fd\u5927\u9646\u90ae\u653f\u7f16\u7801<\/td><td>[1-9]\\d{5}(?!\\d)<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u4e2d\u56fd\u5927\u9646\u90ae\u653f\u7f16\u7801\u4e3a6\u4f4d\u6570\u5b57<\/strong><\/td><\/tr><tr><td>\u5339\u914d\u8eab\u4efd\u8bc1<\/td><td>\\d{15}|\\d{18}<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u4e2d\u56fd\u5927\u9646\u7684\u8eab\u4efd\u8bc1\u4e3a15\u4f4d\u621618\u4f4d<\/strong><\/td><\/tr><tr><td>\u5339\u914dip\u5730\u5740<\/td><td>\\d+\\.\\d+\\.\\d+\\.\\d+<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u63d0\u53d6ip\u5730\u5740\u65f6\u6709\u7528<\/strong><\/td><\/tr><tr><td><strong>\u5339\u914d\u7279\u5b9a\u6570\u5b57\uff1a<\/strong><\/td><\/tr><tr><td>^[1-9]\\d*$<\/td><td>\/\/\u5339\u914d\u6b63\u6574\u6570<\/td><\/tr><tr><td>^-[1-9]\\d*$<\/td><td>\/\/\u5339\u914d\u8d1f\u6574\u6570<\/td><\/tr><tr><td>^-?[1-9]\\d*$<\/td><td>\/\/\u5339\u914d\u6574\u6570<\/td><\/tr><tr><td>^[1-9]\\d*|0$<\/td><td>\/\/\u5339\u914d\u975e\u8d1f\u6574\u6570\uff08\u6b63\u6574\u6570 + 0\uff09<\/td><\/tr><tr><td>^-[1-9]\\d*|0$<\/td><td>\/\/\u5339\u914d\u975e\u6b63\u6574\u6570\uff08\u8d1f\u6574\u6570 + 0\uff09<\/td><\/tr><tr><td>^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*$<\/td><td>\/\/\u5339\u914d\u6b63\u6d6e\u70b9\u6570<\/td><\/tr><tr><td>^-([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*)$<\/td><td>\/\/\u5339\u914d\u8d1f\u6d6e\u70b9\u6570<\/td><\/tr><tr><td>^-?([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0)$<\/td><td>\/\/\u5339\u914d\u6d6e\u70b9\u6570<\/td><\/tr><tr><td>^[1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*|0?\\.0+|0$<\/td><td>\/\/\u5339\u914d\u975e\u8d1f\u6d6e\u70b9\u6570\uff08\u6b63\u6d6e\u70b9\u6570 + 0\uff09<\/td><\/tr><tr><td>^(-([1-9]\\d*\\.\\d*|0\\.\\d*[1-9]\\d*))|0?\\.0+|0$<\/td><td>\/\/\u5339\u914d\u975e\u6b63\u6d6e\u70b9\u6570\uff08\u8d1f\u6d6e\u70b9\u6570 + 0\uff09<\/td><\/tr><tr><td><strong>\u8bc4\u6ce8\uff1a\u5904\u7406\u5927\u91cf\u6570\u636e\u65f6\u6709\u7528\uff0c\u5177\u4f53\u5e94\u7528\u65f6\u6ce8\u610f\u4fee\u6b63<\/strong><\/td><\/tr><tr><td><strong>\u5339\u914d\u7279\u5b9a\u5b57\u7b26\u4e32<\/strong><\/td><\/tr><tr><td>^[A-Za-z]+$<\/td><td>\/\/\u5339\u914d\u753126\u4e2a\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<\/td><\/tr><tr><td>^[A-Z]+$<\/td><td>\/\/\u5339\u914d\u753126\u4e2a\u82f1\u6587\u5b57\u6bcd\u7684\u5927\u5199\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<\/td><\/tr><tr><td>^[a-z]+$<\/td><td>\/\/\u5339\u914d\u753126\u4e2a\u82f1\u6587\u5b57\u6bcd\u7684\u5c0f\u5199\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<\/td><\/tr><tr><td>^[A-Za-z0-9]+$<\/td><td>\/\/\u5339\u914d\u7531\u6570\u5b57\u548c26\u4e2a\u82f1\u6587\u5b57\u6bcd\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<\/td><\/tr><tr><td>^\\w+$<\/td><td>\/\/\u5339\u914d\u7531\u6570\u5b57\u300126\u4e2a\u82f1\u6587\u5b57\u6bcd\u6216\u8005\u4e0b\u5212\u7ebf\u7ec4\u6210\u7684\u5b57\u7b26\u4e32<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u8868\u8fbe\u5f0f\u5168\u96c6<\/h2>\n\n\n\n<p>\u6b63\u5219\u8868\u8fbe\u5f0f\u6709\u591a\u79cd\u4e0d\u540c\u7684\u98ce\u683c\u3002\u4e0b\u8868\u662f\u5728PCRE\u4e2d\u5143\u5b57\u7b26\u53ca\u5176\u5728\u6b63\u5219\u8868\u8fbe\u5f0f\u4e0a\u4e0b\u6587\u4e2d\u7684\u884c\u4e3a\u7684\u4e00\u4e2a\u5b8c\u6574\u5217\u8868\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><th>\u5b57\u7b26<\/th><th>\u63cf\u8ff0<\/th><\/tr><tr><th>\\<\/th><td>\u5c06\u4e0b\u4e00\u4e2a\u5b57\u7b26\u6807\u8bb0\u4e3a\u4e00\u4e2a\u7279\u6b8a\u5b57\u7b26\u3001\u6216\u4e00\u4e2a\u539f\u4e49\u5b57\u7b26\u3001\u6216\u4e00\u4e2a\u5411\u540e\u5f15\u7528\u3001\u6216\u4e00\u4e2a\u516b\u8fdb\u5236\u8f6c\u4e49\u7b26\u3002\u4f8b\u5982\uff0c\u201cn\u201d\u5339\u914d\u5b57\u7b26\u201cn\u201d\u3002\u201c\\n\u201d\u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u5e8f\u5217\u201c\\\\\u201d\u5339\u914d\u201c\\\u201d\u800c\u201c\\(\u201d\u5219\u5339\u914d\u201c(\u201d\u3002<\/td><\/tr><tr><th>^<\/th><td>\u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u5f00\u59cb\u4f4d\u7f6e\u3002\u5982\u679c\u8bbe\u7f6e\u4e86RegExp\u5bf9\u8c61\u7684Multiline\u5c5e\u6027\uff0c^\u4e5f\u5339\u914d\u201c\\n\u201d\u6216\u201c\\r\u201d\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002<\/td><\/tr><tr><th>$<\/th><td>\u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u7ed3\u675f\u4f4d\u7f6e\u3002\u5982\u679c\u8bbe\u7f6e\u4e86RegExp\u5bf9\u8c61\u7684Multiline\u5c5e\u6027\uff0c$\u4e5f\u5339\u914d\u201c\\n\u201d\u6216\u201c\\r\u201d\u4e4b\u524d\u7684\u4f4d\u7f6e\u3002<\/td><\/tr><tr><th>*<\/th><td>\u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u591a\u6b21\u3002\u4f8b\u5982\uff0czo*\u80fd\u5339\u914d\u201cz\u201d\u4ee5\u53ca\u201czoo\u201d\u3002*\u7b49\u4ef7\u4e8e{0,}\u3002<\/td><\/tr><tr><th>+<\/th><td>\u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u4e00\u6b21\u6216\u591a\u6b21\u3002\u4f8b\u5982\uff0c\u201czo+\u201d\u80fd\u5339\u914d\u201czo\u201d\u4ee5\u53ca\u201czoo\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201cz\u201d\u3002+\u7b49\u4ef7\u4e8e{1,}\u3002<\/td><\/tr><tr><th>?<\/th><td>\u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u4e00\u6b21\u3002\u4f8b\u5982\uff0c\u201cdo(es)?\u201d\u53ef\u4ee5\u5339\u914d\u201cdo\u201d\u6216\u201cdoes\u201d\u4e2d\u7684\u201cdo\u201d\u3002?\u7b49\u4ef7\u4e8e{0,1}\u3002<\/td><\/tr><tr><th>{n}<\/th><td>n\u662f\u4e00\u4e2a\u975e\u8d1f\u6574\u6570\u3002\u5339\u914d\u786e\u5b9a\u7684n\u6b21\u3002\u4f8b\u5982\uff0c\u201co{2}\u201d\u4e0d\u80fd\u5339\u914d\u201cBob\u201d\u4e2d\u7684\u201co\u201d\uff0c\u4f46\u662f\u80fd\u5339\u914d\u201cfood\u201d\u4e2d\u7684\u4e24\u4e2ao\u3002<\/td><\/tr><tr><th>{n,}<\/th><td>n\u662f\u4e00\u4e2a\u975e\u8d1f\u6574\u6570\u3002\u81f3\u5c11\u5339\u914dn\u6b21\u3002\u4f8b\u5982\uff0c\u201co{2,}\u201d\u4e0d\u80fd\u5339\u914d\u201cBob\u201d\u4e2d\u7684\u201co\u201d\uff0c\u4f46\u80fd\u5339\u914d\u201cfoooood\u201d\u4e2d\u7684\u6240\u6709o\u3002\u201co{1,}\u201d\u7b49\u4ef7\u4e8e\u201co+\u201d\u3002\u201co{0,}\u201d\u5219\u7b49\u4ef7\u4e8e\u201co*\u201d\u3002<\/td><\/tr><tr><th>{n,m}<\/th><td>m\u548cn\u5747\u4e3a\u975e\u8d1f\u6574\u6570\uff0c\u5176\u4e2dn&lt;=m\u3002\u6700\u5c11\u5339\u914dn\u6b21\u4e14\u6700\u591a\u5339\u914dm\u6b21\u3002\u4f8b\u5982\uff0c\u201co{1,3}\u201d\u5c06\u5339\u914d\u201cfooooood\u201d\u4e2d\u7684\u524d\u4e09\u4e2ao\u3002\u201co{0,1}\u201d\u7b49\u4ef7\u4e8e\u201co?\u201d\u3002\u8bf7\u6ce8\u610f\u5728\u9017\u53f7\u548c\u4e24\u4e2a\u6570\u4e4b\u95f4\u4e0d\u80fd\u6709\u7a7a\u683c\u3002<\/td><\/tr><tr><th>?<\/th><td>\u5f53\u8be5\u5b57\u7b26\u7d27\u8ddf\u5728\u4efb\u4f55\u4e00\u4e2a\u5176\u4ed6\u9650\u5236\u7b26\uff08*,+,?\uff0c{n}\uff0c{n,}\uff0c{n,m}\uff09\u540e\u9762\u65f6\uff0c\u5339\u914d\u6a21\u5f0f\u662f\u975e\u8d2a\u5a6a\u7684\u3002\u975e\u8d2a\u5a6a\u6a21\u5f0f\u5c3d\u53ef\u80fd\u5c11\u7684\u5339\u914d\u6240\u641c\u7d22\u7684\u5b57\u7b26\u4e32\uff0c\u800c\u9ed8\u8ba4\u7684\u8d2a\u5a6a\u6a21\u5f0f\u5219\u5c3d\u53ef\u80fd\u591a\u7684\u5339\u914d\u6240\u641c\u7d22\u7684\u5b57\u7b26\u4e32\u3002\u4f8b\u5982\uff0c\u5bf9\u4e8e\u5b57\u7b26\u4e32\u201coooo\u201d\uff0c\u201co+?\u201d\u5c06\u5339\u914d\u5355\u4e2a\u201co\u201d\uff0c\u800c\u201co+\u201d\u5c06\u5339\u914d\u6240\u6709\u201co\u201d\u3002<\/td><\/tr><tr><th>.<\/th><td>\u5339\u914d\u9664\u201c\\n\u201d\u4e4b\u5916\u7684\u4efb\u4f55\u5355\u4e2a\u5b57\u7b26\u3002\u8981\u5339\u914d\u5305\u62ec\u201c\\n\u201d\u5728\u5185\u7684\u4efb\u4f55\u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528\u50cf\u201c[.\\n]\u201d\u7684\u6a21\u5f0f\u3002<\/td><\/tr><tr><th>(pattern)<\/th><td>\u5339\u914dpattern\u5e76\u83b7\u53d6\u8fd9\u4e00\u5339\u914d\u3002\u6240\u83b7\u53d6\u7684\u5339\u914d\u53ef\u4ee5\u4ece\u4ea7\u751f\u7684Matches\u96c6\u5408\u5f97\u5230\uff0c\u5728VBScript\u4e2d\u4f7f\u7528SubMatches\u96c6\u5408\uff0c\u5728JScript\u4e2d\u5219\u4f7f\u7528$0\u2026$9\u5c5e\u6027\u3002\u8981\u5339\u914d\u5706\u62ec\u53f7\u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528\u201c\\(\u201d\u6216\u201c\\)\u201d\u3002<\/td><\/tr><tr><th>(?:pattern)<\/th><td>\u5339\u914dpattern\u4f46\u4e0d\u83b7\u53d6\u5339\u914d\u7ed3\u679c\uff0c\u4e5f\u5c31\u662f\u8bf4\u8fd9\u662f\u4e00\u4e2a\u975e\u83b7\u53d6\u5339\u914d\uff0c\u4e0d\u8fdb\u884c\u5b58\u50a8\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u8fd9\u5728\u4f7f\u7528\u6216\u5b57\u7b26\u201c(|)\u201d\u6765\u7ec4\u5408\u4e00\u4e2a\u6a21\u5f0f\u7684\u5404\u4e2a\u90e8\u5206\u662f\u5f88\u6709\u7528\u3002\u4f8b\u5982\u201cindustr(?:y|ies)\u201d\u5c31\u662f\u4e00\u4e2a\u6bd4\u201cindustry|industries\u201d\u66f4\u7b80\u7565\u7684\u8868\u8fbe\u5f0f\u3002<\/td><\/tr><tr><th>(?=pattern)<\/th><td>\u6b63\u5411\u9884\u67e5\uff0c\u5728\u4efb\u4f55\u5339\u914dpattern\u7684\u5b57\u7b26\u4e32\u5f00\u59cb\u5904\u5339\u914d\u67e5\u627e\u5b57\u7b26\u4e32\u3002\u8fd9\u662f\u4e00\u4e2a\u975e\u83b7\u53d6\u5339\u914d\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u8be5\u5339\u914d\u4e0d\u9700\u8981\u83b7\u53d6\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u4f8b\u5982\uff0c\u201cWindows(?=95|98|NT|2000)\u201d\u80fd\u5339\u914d\u201cWindows2000\u201d\u4e2d\u7684\u201cWindows\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201cWindows3.1\u201d\u4e2d\u7684\u201cWindows\u201d\u3002\u9884\u67e5\u4e0d\u6d88\u8017\u5b57\u7b26\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u4e00\u4e2a\u5339\u914d\u53d1\u751f\u540e\uff0c\u5728\u6700\u540e\u4e00\u6b21\u5339\u914d\u4e4b\u540e\u7acb\u5373\u5f00\u59cb\u4e0b\u4e00\u6b21\u5339\u914d\u7684\u641c\u7d22\uff0c\u800c\u4e0d\u662f\u4ece\u5305\u542b\u9884\u67e5\u7684\u5b57\u7b26\u4e4b\u540e\u5f00\u59cb\u3002<\/td><\/tr><tr><th>(?!pattern)<\/th><td>\u8d1f\u5411\u9884\u67e5\uff0c\u5728\u4efb\u4f55\u4e0d\u5339\u914dpattern\u7684\u5b57\u7b26\u4e32\u5f00\u59cb\u5904\u5339\u914d\u67e5\u627e\u5b57\u7b26\u4e32\u3002\u8fd9\u662f\u4e00\u4e2a\u975e\u83b7\u53d6\u5339\u914d\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u8be5\u5339\u914d\u4e0d\u9700\u8981\u83b7\u53d6\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u4f8b\u5982\u201cWindows(?!95|98|NT|2000)\u201d\u80fd\u5339\u914d\u201cWindows3.1\u201d\u4e2d\u7684\u201cWindows\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201cWindows2000\u201d\u4e2d\u7684\u201cWindows\u201d\u3002\u9884\u67e5\u4e0d\u6d88\u8017\u5b57\u7b26\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u5728\u4e00\u4e2a\u5339\u914d\u53d1\u751f\u540e\uff0c\u5728\u6700\u540e\u4e00\u6b21\u5339\u914d\u4e4b\u540e\u7acb\u5373\u5f00\u59cb\u4e0b\u4e00\u6b21\u5339\u914d\u7684\u641c\u7d22\uff0c\u800c\u4e0d\u662f\u4ece\u5305\u542b\u9884\u67e5\u7684\u5b57\u7b26\u4e4b\u540e\u5f00\u59cb<\/td><\/tr><tr><th>x|y<\/th><td>\u5339\u914dx\u6216y\u3002\u4f8b\u5982\uff0c\u201cz|food\u201d\u80fd\u5339\u914d\u201cz\u201d\u6216\u201cfood\u201d\u3002\u201c(z|f)ood\u201d\u5219\u5339\u914d\u201czood\u201d\u6216\u201cfood\u201d\u3002<\/td><\/tr><tr><th>[xyz]<\/th><td>\u5b57\u7b26\u96c6\u5408\u3002\u5339\u914d\u6240\u5305\u542b\u7684\u4efb\u610f\u4e00\u4e2a\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u201c[abc]\u201d\u53ef\u4ee5\u5339\u914d\u201cplain\u201d\u4e2d\u7684\u201ca\u201d\u3002<\/td><\/tr><tr><th>[^xyz]<\/th><td>\u8d1f\u503c\u5b57\u7b26\u96c6\u5408\u3002\u5339\u914d\u672a\u5305\u542b\u7684\u4efb\u610f\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u201c[^abc]\u201d\u53ef\u4ee5\u5339\u914d\u201cplain\u201d\u4e2d\u7684\u201cp\u201d\u3002<\/td><\/tr><tr><th>[a-z]<\/th><td>\u5b57\u7b26\u8303\u56f4\u3002\u5339\u914d\u6307\u5b9a\u8303\u56f4\u5185\u7684\u4efb\u610f\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u201c[a-z]\u201d\u53ef\u4ee5\u5339\u914d\u201ca\u201d\u5230\u201cz\u201d\u8303\u56f4\u5185\u7684\u4efb\u610f\u5c0f\u5199\u5b57\u6bcd\u5b57\u7b26\u3002<\/td><\/tr><tr><th>[^a-z]<\/th><td>\u8d1f\u503c\u5b57\u7b26\u8303\u56f4\u3002\u5339\u914d\u4efb\u4f55\u4e0d\u5728\u6307\u5b9a\u8303\u56f4\u5185\u7684\u4efb\u610f\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u201c[^a-z]\u201d\u53ef\u4ee5\u5339\u914d\u4efb\u4f55\u4e0d\u5728\u201ca\u201d\u5230\u201cz\u201d\u8303\u56f4\u5185\u7684\u4efb\u610f\u5b57\u7b26\u3002<\/td><\/tr><tr><th>\\b<\/th><td>\u5339\u914d\u4e00\u4e2a\u5355\u8bcd\u8fb9\u754c\uff0c\u4e5f\u5c31\u662f\u6307\u5355\u8bcd\u548c\u7a7a\u683c\u95f4\u7684\u4f4d\u7f6e\u3002\u4f8b\u5982\uff0c\u201cer\\b\u201d\u53ef\u4ee5\u5339\u914d\u201cnever\u201d\u4e2d\u7684\u201cer\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201cverb\u201d\u4e2d\u7684\u201cer\u201d\u3002<\/td><\/tr><tr><th>\\B<\/th><td>\u5339\u914d\u975e\u5355\u8bcd\u8fb9\u754c\u3002\u201cer\\B\u201d\u80fd\u5339\u914d\u201cverb\u201d\u4e2d\u7684\u201cer\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201cnever\u201d\u4e2d\u7684\u201cer\u201d\u3002<\/td><\/tr><tr><th>\\cx<\/th><td>\u5339\u914d\u7531x\u6307\u660e\u7684\u63a7\u5236\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\\cM\u5339\u914d\u4e00\u4e2aControl-M\u6216\u56de\u8f66\u7b26\u3002x\u7684\u503c\u5fc5\u987b\u4e3aA-Z\u6216a-z\u4e4b\u4e00\u3002\u5426\u5219\uff0c\u5c06c\u89c6\u4e3a\u4e00\u4e2a\u539f\u4e49\u7684\u201cc\u201d\u5b57\u7b26\u3002<\/td><\/tr><tr><th>\\d<\/th><td>\u5339\u914d\u4e00\u4e2a\u6570\u5b57\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e[0-9]\u3002<\/td><\/tr><tr><th>\\D<\/th><td>\u5339\u914d\u4e00\u4e2a\u975e\u6570\u5b57\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e[^0-9]\u3002<\/td><\/tr><tr><th>\\f<\/th><td>\u5339\u914d\u4e00\u4e2a\u6362\u9875\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0c\u548c\\cL\u3002<\/td><\/tr><tr><th>\\n<\/th><td>\u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0a\u548c\\cJ\u3002<\/td><\/tr><tr><th>\\r<\/th><td>\u5339\u914d\u4e00\u4e2a\u56de\u8f66\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0d\u548c\\cM\u3002<\/td><\/tr><tr><th>\\s<\/th><td>\u5339\u914d\u4efb\u4f55\u7a7a\u767d\u5b57\u7b26\uff0c\u5305\u62ec\u7a7a\u683c\u3001\u5236\u8868\u7b26\u3001\u6362\u9875\u7b26\u7b49\u7b49\u3002\u7b49\u4ef7\u4e8e[\\f\\n\\r\\t\\v]\u3002<\/td><\/tr><tr><th>\\S<\/th><td>\u5339\u914d\u4efb\u4f55\u975e\u7a7a\u767d\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e[^\\f\\n\\r\\t\\v]\u3002<\/td><\/tr><tr><th>\\t<\/th><td>\u5339\u914d\u4e00\u4e2a\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e\\x09\u548c\\cI\u3002<\/td><\/tr><tr><th>\\v<\/th><td>\u5339\u914d\u4e00\u4e2a\u5782\u76f4\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0b\u548c\\cK\u3002<\/td><\/tr><tr><th>\\w<\/th><td>\u5339\u914d\u5305\u62ec\u4e0b\u5212\u7ebf\u7684\u4efb\u4f55\u5355\u8bcd\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e\u201c[A-Za-z0-9_]\u201d\u3002<\/td><\/tr><tr><th>\\W<\/th><td>\u5339\u914d\u4efb\u4f55\u975e\u5355\u8bcd\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e\u201c[^A-Za-z0-9_]\u201d\u3002<\/td><\/tr><tr><th>\\xn<\/th><td>\u5339\u914dn\uff0c\u5176\u4e2dn\u4e3a\u5341\u516d\u8fdb\u5236\u8f6c\u4e49\u503c\u3002\u5341\u516d\u8fdb\u5236\u8f6c\u4e49\u503c\u5fc5\u987b\u4e3a\u786e\u5b9a\u7684\u4e24\u4e2a\u6570\u5b57\u957f\u3002\u4f8b\u5982\uff0c\u201c\\x41\u201d\u5339\u914d\u201cA\u201d\u3002\u201c\\x041\u201d\u5219\u7b49\u4ef7\u4e8e\u201c\\x04&amp;1\u201d\u3002\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u53ef\u4ee5\u4f7f\u7528ASCII\u7f16\u7801\u3002.<\/td><\/tr><tr><th>\\num<\/th><td>\u5339\u914dnum\uff0c\u5176\u4e2dnum\u662f\u4e00\u4e2a\u6b63\u6574\u6570\u3002\u5bf9\u6240\u83b7\u53d6\u7684\u5339\u914d\u7684\u5f15\u7528\u3002\u4f8b\u5982\uff0c\u201c(.)\\1\u201d\u5339\u914d\u4e24\u4e2a\u8fde\u7eed\u7684\u76f8\u540c\u5b57\u7b26\u3002<\/td><\/tr><tr><th>\\n<\/th><td>\u6807\u8bc6\u4e00\u4e2a\u516b\u8fdb\u5236\u8f6c\u4e49\u503c\u6216\u4e00\u4e2a\u5411\u540e\u5f15\u7528\u3002\u5982\u679c\\n\u4e4b\u524d\u81f3\u5c11n\u4e2a\u83b7\u53d6\u7684\u5b50\u8868\u8fbe\u5f0f\uff0c\u5219n\u4e3a\u5411\u540e\u5f15\u7528\u3002\u5426\u5219\uff0c\u5982\u679cn\u4e3a\u516b\u8fdb\u5236\u6570\u5b57\uff080-7\uff09\uff0c\u5219n\u4e3a\u4e00\u4e2a\u516b\u8fdb\u5236\u8f6c\u4e49\u503c\u3002<\/td><\/tr><tr><th>\\nm<\/th><td>\u6807\u8bc6\u4e00\u4e2a\u516b\u8fdb\u5236\u8f6c\u4e49\u503c\u6216\u4e00\u4e2a\u5411\u540e\u5f15\u7528\u3002\u5982\u679c\\nm\u4e4b\u524d\u81f3\u5c11\u6709nm\u4e2a\u83b7\u5f97\u5b50\u8868\u8fbe\u5f0f\uff0c\u5219nm\u4e3a\u5411\u540e\u5f15\u7528\u3002\u5982\u679c\\nm\u4e4b\u524d\u81f3\u5c11\u6709n\u4e2a\u83b7\u53d6\uff0c\u5219n\u4e3a\u4e00\u4e2a\u540e\u8ddf\u6587\u5b57m\u7684\u5411\u540e\u5f15\u7528\u3002\u5982\u679c\u524d\u9762\u7684\u6761\u4ef6\u90fd\u4e0d\u6ee1\u8db3\uff0c\u82e5n\u548cm\u5747\u4e3a\u516b\u8fdb\u5236\u6570\u5b57\uff080-7\uff09\uff0c\u5219\\nm\u5c06\u5339\u914d\u516b\u8fdb\u5236\u8f6c\u4e49\u503cnm\u3002<\/td><\/tr><tr><th>\\nml<\/th><td>\u5982\u679cn\u4e3a\u516b\u8fdb\u5236\u6570\u5b57\uff080-3\uff09\uff0c\u4e14m\u548cl\u5747\u4e3a\u516b\u8fdb\u5236\u6570\u5b57\uff080-7\uff09\uff0c\u5219\u5339\u914d\u516b\u8fdb\u5236\u8f6c\u4e49\u503cnml\u3002<\/td><\/tr><tr><th>\\un<\/th><td>\u5339\u914dn\uff0c\u5176\u4e2dn\u662f\u4e00\u4e2a\u7528\u56db\u4e2a\u5341\u516d\u8fdb\u5236\u6570\u5b57\u8868\u793a\u7684Unicode\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\\u00A9\u5339\u914d\u7248\u6743\u7b26\u53f7\uff08?\uff09\u3002<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u4ee5PHP\u7684\u8bed\u6cd5\u6240\u5199\u7684\u793a\u4f8b<\/p>\n\n\n\n<p>\u9a8c\u8bc1\u5b57\u7b26\u4e32\u662f\u5426\u53ea\u542b\u6570\u5b57\u4e0e\u82f1\u6587\uff0c\u5b57\u7b26\u4e32\u957f\u5ea6\u5e76\u57284~16\u4e2a\u5b57\u7b26\u4e4b\u95f4<br><br>&lt;?php<br>$str = &#8216;a1234&#8217;;<br>if (preg_match(&#8220;^[a-zA-Z0-9]{4,16}$&#8221;, $str)) {<br>echo &#8220;\u9a8c\u8bc1\u6210\u529f&#8221;;<br>} else {<br>echo &#8220;\u9a8c\u8bc1\u5931\u6557&#8221;;<br>}<br>?&gt;<br><br>\u7b80\u6613\u7684\u53f0\u6e7e\u8eab\u4efd\u8bc1\u5b57\u53f7\u9a8c\u8bc1<\/p>\n\n\n\n<p>&lt;?php<br>$str = &#8216;a1234&#8217;;<br>if (preg_match(&#8220;\/^\\w[12]\\d{8}$\/&#8221;, $str)) {<br>echo &#8220;\u9a8c\u8bc1\u6210\u529f&#8221;;<br>} else {<br>echo &#8220;\u9a8c\u8bc1\u5931\u6557&#8221;;<br>}<br>?&gt;<br><br>\u4ee5\u4e0b\u793a\u4f8b\u662f\u7528 Perl \u8bed\u8a00\u5199\u7684\uff0c\u4e0e\u4e0a\u9762\u7684\u793a\u4f8b\u529f\u80fd\u76f8\u540c<br>print $str = &#8220;a1234&#8221; =~ m:^[a-zA-Z0-9]{4,16}$: ? &#8220;COMFIRM&#8221; : &#8220;FAILED&#8221;;<br>print $str = &#8220;a1234&#8243; =~ m&#8221;^\\w[12]\\d{8}$&#8221; ? &#8220;COMFIRM&#8221; : &#8220;INVAILD&#8221;;<\/p>\n\n\n\n<p><a href=\"http:\/\/validator.w3.org\/check?uri=referer\">Validated XHTML 1.0 Strict<\/a>&nbsp;<a href=\"http:\/\/jigsaw.w3.org\/css-validator\/check\/referer\">Validated CSS 2.1<\/a><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u5982\u4f55\u5199\u51fa\u9ad8\u6548\u7387\u7684\u6b63\u5219\u8868\u8fbe\u5f0f<\/h4>\n\n\n\n<p>\u5982\u679c\u7eaf\u7cb9\u662f\u4e3a\u4e86\u6311\u6218\u81ea\u5df1\u7684\u6b63\u5219\u6c34\u5e73\uff0c\u7528\u6765\u5b9e\u73b0\u4e00\u4e9b\u7279\u6548\uff08\u4f8b\u5982\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8ba1\u7b97\u8d28\u6570\u3001\u89e3\u7ebf\u6027\u65b9\u7a0b\uff09\uff0c\u6548\u7387\u4e0d\u662f\u95ee\u9898\uff1b\u5982\u679c\u6240\u5199\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u53ea\u662f\u4e3a\u4e86\u6ee1\u8db3\u4e00\u4e24\u6b21\u3001\u51e0\u5341\u6b21\u7684\u8fd0\u884c\uff0c\u4f18\u5316\u4e0e\u5426\u533a\u522b\u4e5f\u4e0d\u592a\u5927\u3002\u4f46\u662f\uff0c\u5982\u679c\u6240\u5199\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u4f1a\u767e\u4e07\u6b21\u3001\u5343\u4e07\u6b21\u5730\u8fd0\u884c\uff0c\u6548\u7387\u5c31\u662f\u5f88\u5927\u7684\u95ee\u9898\u4e86\u3002\u6211\u8fd9\u91cc\u603b\u7ed3\u4e86\u51e0\u6761\u63d0\u5347\u6b63\u5219\u8868\u8fbe\u5f0f\u8fd0\u884c\u6548\u7387\u7684\u7ecf\u9a8c\uff08\u5de5\u4f5c\u4e2d\u5b66\u5230\u7684\uff0c\u770b\u4e66\u5b66\u6765\u7684\uff0c\u81ea\u5df1\u7684\u4f53\u4f1a\uff09\uff0c\u8d34\u5728\u8fd9\u91cc\u3002\u5982\u679c\u60a8\u6709\u5176\u5b83\u7684\u7ecf\u9a8c\u800c\u8fd9\u91cc\u6ca1\u6709\u63d0\u53ca\uff0c\u6b22\u8fce\u8d50\u6559\u3002<\/p>\n\n\n\n<p>\u4e3a\u884c\u6587\u65b9\u4fbf\uff0c\u5148\u5b9a\u4e49\u4e24\u4e2a\u6982\u5ff5\u3002<\/p>\n\n\n\n<p><strong>\u8bef\u5339\u914d<\/strong>\uff1a\u6307\u6b63\u5219\u8868\u8fbe\u5f0f\u6240\u5339\u914d\u7684\u5185\u5bb9\u8303\u56f4\u8d85\u51fa\u4e86\u6240\u9700\u8981\u8303\u56f4\uff0c\u6709\u4e9b\u6587\u672c\u660e\u660e\u4e0d\u7b26\u5408\u8981\u6c42\uff0c\u4f46\u662f\u88ab\u6240\u5199\u7684\u6b63\u5219\u5f0f\u201c\u51fb\u4e2d\u4e86\u201d\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f7f\u7528\\d{11}\u6765\u5339\u914d11\u4f4d\u7684\u624b\u673a\u53f7\uff0c\\d{11}\u4e0d\u5355\u80fd\u5339\u914d\u6b63\u786e\u7684\u624b\u673a\u53f7\uff0c\u5b83\u8fd8\u4f1a\u5339\u914d98765432100\u8fd9\u6837\u7684\u660e\u663e\u4e0d\u662f\u624b\u673a\u53f7\u7684\u5b57\u7b26\u4e32\u3002\u6211\u4eec\u628a\u8fd9\u6837\u7684\u5339\u914d\u79f0\u4e4b\u4e3a\u8bef\u5339\u914d\u3002<\/p>\n\n\n\n<p><strong>\u6f0f\u5339\u914d<\/strong>\uff1a\u6307\u6b63\u5219\u8868\u8fbe\u5f0f\u6240\u5339\u914d\u7684\u5185\u5bb9\u6240\u89c4\u5b9a\u7684\u8303\u56f4\u592a\u72ed\u7a84\uff0c\u6709\u4e9b\u6587\u672c\u786e\u5b9e\u662f\u6240\u9700\u8981\u7684\uff0c\u4f46\u662f\u6240\u5199\u7684\u6b63\u5219\u6ca1\u6709\u5c06\u8fd9\u79cd\u60c5\u51b5\u56ca\u62ec\u5728\u5185\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\\d{18}\u6765\u5339\u914d18\u4f4d\u7684\u8eab\u4efd\u8bc1\u53f7\u7801\uff0c\u5c31\u4f1a\u6f0f\u6389\u7ed3\u5c3e\u662f\u5b57\u6bcdX\u7684\u60c5\u51b5\u3002<\/p>\n\n\n\n<p>\u5199\u51fa\u4e00\u6761\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u65e2\u53ef\u80fd<strong>\u53ea\u51fa\u73b0<\/strong>\u8bef\u5339\u914d\uff08\u6761\u4ef6\u5199\u5f97\u6781\u5bbd\u677e\uff0c\u5176\u8303\u56f4\u5927\u4e8e\u76ee\u6807\u6587\u672c\uff09\uff0c\u4e5f\u53ef\u80fd<strong>\u53ea\u51fa\u73b0<\/strong>\u6f0f\u5339\u914d\uff08\u53ea\u63cf\u8ff0\u4e86\u76ee\u6807\u6587\u672c\u4e2d\u591a\u79cd\u60c5\u51b5\u79cd\u7684\u4e00\u79cd\uff09\uff0c\u8fd8\u53ef\u80fd<strong>\u65e2\u6709\u8bef\u5339\u914d\u53c8\u6709\u6f0f\u5339\u914d<\/strong>\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\\w+\\.com\u6765\u5339\u914d.com\u7ed3\u5c3e\u7684\u57df\u540d\uff0c\u65e2\u4f1a\u8bef\u5339\u914dabc_.com\u8fd9\u6837\u7684\u5b57\u4e32\uff08\u5408\u6cd5\u7684\u57df\u540d\u4e2d\u4e0d\u542b\u4e0b\u5212\u7ebf\uff0c\\w\u5305\u542b\u4e86\u4e0b\u5212\u7ebf\u8fd9\u79cd\u60c5\u51b5\uff09\uff0c\u53c8\u4f1a\u6f0f\u6389ab-c.com\u8fd9\u6837\u7684\u57df\u540d\uff08\u5408\u6cd5\u57df\u540d\u4e2d\u53ef\u4ee5\u542b\u4e2d\u5212\u7ebf\uff0c\u4f46\u662f\\w\u4e0d\u5339\u914d\u4e2d\u5212\u7ebf\uff09\u3002<\/p>\n\n\n\n<p>\u7cbe\u51c6\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u610f\u5473\u7740\u65e2\u65e0\u8bef\u5339\u914d\u4e14\u65e0\u6f0f\u5339\u914d\u3002\u5f53\u7136\uff0c\u73b0\u5b9e\u4e2d\u5b58\u5728\u8fd9\u6837\u7684\u60c5\u51b5\uff1a\u53ea\u80fd\u770b\u5230\u6709\u9650\u6570\u91cf\u7684\u6587\u672c\uff0c\u6839\u636e\u8fd9\u4e9b\u6587\u672c\u5199\u89c4\u5219\uff0c\u4f46\u662f\u8fd9\u4e9b\u89c4\u5219\u5c06\u4f1a\u7528\u5230\u6d77\u91cf\u7684\u6587\u672c\u4e2d\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5c3d\u53ef\u80fd\u5730\uff08\u5982\u679c\u4e0d\u662f\u5b8c\u5168\u5730\uff09\u6d88\u9664\u8bef\u5339\u914d\u4ee5\u53ca\u6f0f\u5339\u914d\uff0c\u5e76\u63d0\u5347\u8fd0\u884c\u6548\u7387\uff0c\u5c31\u662f\u6211\u4eec\u7684\u76ee\u6807\u3002\u672c\u6587\u6240\u63d0\u51fa\u7684\u7ecf\u9a8c\uff0c\u4e3b\u8981\u662f\u9488\u5bf9\u8fd9\u79cd\u60c5\u51b5\u3002<\/p>\n\n\n\n<p><strong>\u638c\u63e1\u8bed\u6cd5\u7ec6\u8282<\/strong>\u3002\u6b63\u5219\u8868\u8fbe\u5f0f\u5728\u5404\u79cd\u8bed\u8a00\u4e2d\uff0c\u5176\u8bed\u6cd5\u5927\u81f4\u76f8\u540c\uff0c\u7ec6\u8282\u5404\u6709\u5343\u79cb\u3002\u660e\u786e\u6240\u4f7f\u7528\u8bed\u8a00\u7684\u6b63\u5219\u7684\u8bed\u6cd5\u7684\u7ec6\u8282\uff0c\u662f\u5199\u51fa\u6b63\u786e\u3001\u9ad8\u6548\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u57fa\u7840\u3002\u4f8b\u5982\uff0cperl\u4e2d\u4e0e\\w\u7b49\u6548\u7684\u5339\u914d\u8303\u56f4\u662f[a-zA-Z0-9_]\uff1bperl\u6b63\u5219\u5f0f\u4e0d\u652f\u6301\u80af\u5b9a\u9006\u5e8f\u73af\u89c6\u4e2d\u4f7f\u7528\u53ef\u53d8\u7684\u91cd\u590d\uff08variable repetition inside lookbehind\uff0c\u4f8b\u5982(?&lt;=.*)abc\uff09\uff0c\u4f46\u662f.Net\u8bed\u6cd5\u662f\u652f\u6301\u8fd9\u4e00\u7279\u6027\u7684\uff1b\u53c8\u5982\uff0cJavaScript\u8fde\u9006\u5e8f\u73af\u89c6\uff08Lookbehind,\u5982(?&lt;=ab)c\uff09\u90fd\u4e0d\u652f\u6301\uff0c\u800cperl\u548cpython\u662f\u652f\u6301\u7684\u3002\u300a\u7cbe\u901a\u6b63\u5219\u8868\u8fbe\u5f0f\u300b\u7b2c3\u7ae0\u300a\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u7279\u6027\u548c\u6d41\u6d3e\u6982\u89c8\u300b\u660e\u786e\u5730\u5217\u51fa\u4e86\u5404\u5927\u6d3e\u7cfb\u6b63\u5219\u7684\u5f02\u540c\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e5f\u7b80\u8981\u5730\u5217\u51fa\u4e86\u51e0\u79cd\u5e38\u7528\u8bed\u8a00\u3001\u5de5\u5177\u4e2d\u6b63\u5219\u7684\u6bd4\u8f83\u3002\u5bf9\u4e8e\u5177\u4f53\u4f7f\u7528\u8005\u800c\u8a00\uff0c\u81f3\u5c11\u5e94\u8be5\u8be6\u7ec6\u4e86\u89e3\u6b63\u5728\u4f7f\u7528\u7684\u90a3\u79cd\u5de5\u4f5c\u8bed\u8a00\u91cc\u6b63\u5219\u7684\u8bed\u6cd5\u7ec6\u8282\u3002<\/p>\n\n\n\n<p><strong>\u5148\u7c97\u540e\u7cbe\uff0c<\/strong><strong>\u5148\u52a0\u540e\u51cf<\/strong>\u3002\u4f7f\u7528\u6b63\u5219\u8868\u8fbe\u5f0f\u8bed\u6cd5\u5bf9\u4e8e\u76ee\u6807\u6587\u672c\u8fdb\u884c\u63cf\u8ff0\u548c\u754c\u5b9a\uff0c\u53ef\u4ee5\u50cf\u753b\u7d20\u63cf\u4e00\u6837\uff0c\u5148\u5927\u81f4\u52fe\u52d2\u51fa\u6846\u67b6\uff0c\u518d\u9010\u6b65\u5728\u5c40\u6b65\u5b9e\u73b0\u7ec6\u8282\u3002\u4ecd\u4e3e\u521a\u624d\u7684\u624b\u673a\u53f7\u7684\u4f8b\u5b50\uff0c\u5148\u754c\u5b9a\\d{11}\uff0c\u603b\u4e0d\u4f1a\u9519\uff1b\u518d\u7ec6\u5316\u4e3a1[358]\\d{9}\uff0c\u5c31\u5411\u524d\u8fc8\u4e86\u4e00\u5927\u6b65\uff08\u81f3\u4e8e\u7b2c\u4e8c\u4f4d\u662f\u4e0d\u662f3\u30015\u30018\uff0c\u8fd9\u91cc\u65e0\u610f\u6df1\u7a76\uff0c\u53ea\u4e3e\u8fd9\u6837\u4e00\u4e2a\u4f8b\u5b50\uff0c\u8bf4\u660e\u9010\u6b65\u7ec6\u5316\u7684\u8fc7\u7a0b\uff09\u3002\u8fd9\u6837\u505a\u7684\u76ee\u7684\u662f\u5148\u6d88\u9664\u6f0f\u5339\u914d\uff08\u521a\u5f00\u59cb\u5148\u5c3d\u53ef\u80fd\u591a\u5730\u5339\u914d\uff0c\u505a\u52a0\u6cd5\uff09\uff0c\u7136\u540e\u518d\u4e00\u70b9\u4e00\u70b9\u5730\u6d88\u9664\u8bef\u5339\u914d\uff08\u505a\u51cf\u6cd5\uff09\u3002\u8fd9\u6837\u6709\u5148\u6709\u540e\uff0c\u5728\u8003\u8651\u65f6\u624d\u4e0d\u6613\u51fa\u9519\uff0c\u4ece\u800c\u5411\u201c\u4e0d\u8bef\u4e0d\u6f0f\u201d\u8fd9\u4e2a\u76ee\u6807\u8fc8\u8fdb\u3002<\/p>\n\n\n\n<p><strong>\u7559\u6709\u4f59\u5730<\/strong>\u3002\u6240\u80fd\u770b\u5230\u7684\u6587\u672csample\u662f\u6709\u9650\u7684\uff0c\u800c\u5f85\u5339\u914d\u68c0\u9a8c\u7684\u6587\u672c\u662f\u6d77\u91cf\u7684\uff0c\u6682\u65f6\u4e0d\u53ef\u89c1\u7684\u3002\u5bf9\u4e8e\u8fd9\u6837\u7684\u60c5\u51b5\uff0c\u5728\u5199\u6b63\u5219\u8868\u8fbe\u5f0f\u65f6\u8981\u8df3\u51fa\u6240\u80fd\u89c1\u5230\u7684\u6587\u672c\u7684\u5708\u5b50\uff0c\u5f00\u62d3\u601d\u8def\uff0c\u4f5c\u51fa\u201c\u6218\u7565\u6027\u524d\u77bb\u201d\u3002\u4f8b\u5982\uff0c\u7ecf\u5e38\u6536\u5230\u8fd9\u6837\u7684\u5783\u573e\u77ed\u4fe1\uff1a\u201c\u53d1*\u7968\u201d\u3001\u201c\u53d1#\u6f02\u201d\u3002\u5982\u679c\u8981\u5199\u89c4\u5219\u5c4f\u853d\u8fd9\u6837\u70e6\u4eba\u7684\u5783\u573e\u77ed\u4fe1\uff0c\u4e0d\u4f46\u8981\u80fd\u5199\u51fa\u53ef\u4ee5\u5339\u914d\u5f53\u524d\u6587\u672c\u7684\u6b63\u5219\u8868\u8fbe\u5f0f \u53d1[*#](?:\u7968|\u6f02)\uff0c\u8fd8\u8981\u80fd\u591f\u60f3\u5230 \u53d1.(?:\u7968|\u6f02|\u98d8)\u4e4b\u7c7b\u53ef\u80fd\u51fa\u73b0\u7684\u201c\u53d8\u79cd\u201d\u3002\u8fd9\u5728\u5177\u4f53\u7684\u9886\u57df\u6216\u8bb8\u4f1a\u6709\u9488\u5bf9\u6027\u7684\u89c4\u5219\uff0c\u4e0d\u591a\u8a00\u3002\u8fd9\u6837\u505a\u7684\u76ee\u7684\u662f\u6d88\u9664\u6f0f\u5339\u914d\uff0c\u5ef6\u957f\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u751f\u547d\u5468\u671f\u3002<\/p>\n\n\n\n<p><strong>\u660e\u786e<\/strong>\u3002\u5177\u4f53\u8bf4\u6765\uff0c\u5c31\u662f<strong>\u8c28\u614e<\/strong>\u7528\u70b9\u53f7\u8fd9\u6837\u7684\u5143\u5b57\u7b26\uff0c<strong>\u5c3d\u53ef\u80fd<\/strong>\u4e0d\u7528\u661f\u53f7\u548c\u52a0\u53f7\u8fd9\u6837\u7684\u4efb\u610f\u91cf\u8bcd\u3002\u53ea\u8981\u80fd\u786e\u5b9a\u8303\u56f4\u7684\uff0c\u4f8b\u5982\\w\uff0c\u5c31\u4e0d\u8981\u7528\u70b9\u53f7\uff1b\u53ea\u8981\u80fd\u591f\u9884\u6d4b\u91cd\u590d\u6b21\u6570\u7684\uff0c\u5c31\u4e0d\u8981\u7528\u4efb\u610f\u91cf\u8bcd\u3002\u4f8b\u5982\uff0c\u5199\u6790\u53d6twitter\u6d88\u606f\u7684\u811a\u672c\uff0c\u5047\u8bbe\u4e00\u6761\u6d88\u606f\u7684xml\u6b63\u6587\u90e8\u5206\u7ed3\u6784\u662f&lt;span class=\u201dmsg\u201d&gt;\u2026&lt;\/span&gt;\u4e14\u6b63\u6587\u4e2d\u65e0\u5c16\u62ec\u53f7\uff0c\u90a3\u4e48&lt;span class=\u201dmsg\u201d&gt;[^&lt;]{1,480}&lt;\/span&gt;\u8fd9\u79cd\u5199\u6cd5<strong>\u7684\u601d\u8def<\/strong>\u8981\u597d\u4e8e&lt;span class=\u201dmsg\u201d&gt;.*&lt;\/span&gt;\uff0c\u539f\u56e0\u6709\u4e8c\uff1a\u4e00\u662f\u4f7f\u7528[^&lt;]\uff0c\u5b83\u4fdd\u8bc1\u4e86\u6587\u672c\u7684\u8303\u56f4\u4e0d\u4f1a\u8d85\u51fa\u4e0b\u4e00\u4e2a\u5c0f\u4e8e\u53f7\u6240\u5728\u7684\u4f4d\u7f6e\uff1b\u4e8c\u662f\u660e\u786e\u957f\u5ea6\u8303\u56f4\uff0c{1,480}\uff0c\u5176\u4f9d\u636e\u662f\u4e00\u6761twitter\u6d88\u606f\u5927\u81f4\u80fd\u7684\u5b57\u7b26\u957f\u5ea6\u8303\u56f4\u3002\u5f53\u7136\uff0c480\u8fd9\u4e2a\u957f\u5ea6\u662f\u5426\u6b63\u786e\u8fd8\u53ef\u63a8\u6572\uff0c\u4f46\u662f\u8fd9\u79cd\u601d\u8def\u662f\u503c\u5f97\u501f\u9274\u7684\u3002\u8bf4\u5f97\u72e0\u4e00\u70b9\uff0c\u201c\u6ee5\u7528\u70b9\u53f7\u3001\u661f\u53f7\u548c\u52a0\u53f7\u662f\u4e0d\u73af\u4fdd\u3001\u4e0d\u8d1f\u8d23\u4efb\u7684\u505a\u6cd5\u201d\u3002<\/p>\n\n\n\n<p><strong>\u4e0d\u8981\u8ba9\u7a3b\u8349\u538b\u6b7b\u9a86\u9a7c<\/strong>\u3002\u6bcf\u4f7f\u7528\u4e00\u4e2a\u666e\u901a\u62ec\u53f7()\u800c\u4e0d\u662f\u975e\u6355\u83b7\u578b\u62ec\u53f7(?:\u2026)\uff0c\u5c31\u4f1a\u4fdd\u7559\u4e00\u90e8\u5206\u5185\u5b58\u7b49\u7740\u4f60\u518d\u6b21\u8bbf\u95ee\u3002\u8fd9\u6837\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u3001\u65e0\u9650\u6b21\u5730\u8fd0\u884c\u6b21\u6570\uff0c\u65e0\u5f02\u4e8e\u4e00\u6839\u6839\u7a3b\u8349\u7684\u5806\u52a0\uff0c\u7ec8\u4e8e\u80fd\u5c06\u9a86\u9a7c\u538b\u6b7b\u3002\u517b\u6210\u5408\u7406\u4f7f\u7528(?:\u2026)\u62ec\u53f7\u7684\u4e60\u60ef\u3002<\/p>\n\n\n\n<p><strong>\u5b81\u7b80\u52ff\u7e41<\/strong>\u3002\u5c06\u4e00\u6761\u590d\u6742\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u62c6\u5206\u4e3a\u4e24\u6761\u6216\u591a\u6761\u7b80\u5355\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u7f16\u7a0b\u96be\u5ea6\u4f1a\u964d\u4f4e\uff0c\u8fd0\u884c\u6548\u7387\u4f1a\u63d0\u5347\u3002\u4f8b\u5982\u7528\u6765\u6d88\u9664\u884c\u9996\u548c\u884c\u5c3e\u7a7a\u767d\u5b57\u7b26\u7684\u6b63\u5219\u8868\u8fbe\u5f0fs\/^\\s+|\\s+$\/\/g;\uff0c\u5176\u8fd0\u884c\u6548\u7387\u7406\u8bba\u4e0a\u8981\u4f4e\u4e8es\/^\\s+\/\/g; s\/\\s+$\/\/g; \u3002\u8fd9\u4e2a\u4f8b\u5b50\u51fa\u81ea\u300a\u7cbe\u901a\u6b63\u5219\u8868\u8fbe\u5f0f\u300b\u7b2c\u4e94\u7ae0\uff0c\u4e66\u4e2d\u5bf9\u5b83\u7684\u8bc4\u8bba\u662f\u201c\u5b83\u51e0\u4e4e\u603b\u662f\u6700\u5feb\u7684\uff0c\u800c\u4e14\u663e\u7136\u6700\u5bb9\u6613\u7406\u89e3\u201d\u3002\u65e2\u5feb\u53c8\u5bb9\u6613\u7406\u89e3\uff0c\u4f55\u4e50\u800c\u4e0d\u4e3a\uff1f\u5de5\u4f5c\u4e2d\u6211\u4eec\u8fd8\u6709\u5176\u5b83\u7684\u7406\u7531\u8981\u5c06C==(A|B)\u8fd9\u6837\u7684\u6b63\u5219\u8868\u8fbe\u5f0f\u62c6\u4e3aA\u548cB\u4e24\u6761\u8868\u8fbe\u5f0f\u5206\u522b\u6267\u884c\u3002\u4f8b\u5982\uff0c\u867d\u7136A\u548cB\u8fd9\u4e24\u79cd\u60c5\u51b5\u53ea\u8981\u6709\u4e00\u79cd\u80fd\u591f\u51fb\u4e2d\u6240\u9700\u8981\u7684\u6587\u672c\u6a21\u5f0f\u5c31\u4f1a\u6210\u529f\u5339\u914d\uff0c\u4f46\u662f\u5982\u679c\u53ea\u8981\u6709\u4e00\u6761\u5b50\u8868\u8fbe\u5f0f\uff08\u4f8b\u5982A\uff09\u4f1a\u4ea7\u751f\u8bef\u5339\u914d\uff0c\u90a3\u4e48\u4e0d\u8bba\u5176\u5b83\u7684\u5b50\u8868\u8fbe\u5f0f\uff08\u4f8b\u5982B\uff09\u6548\u7387\u5982\u4f55\u4e4b\u9ad8\uff0c\u8303\u56f4\u5982\u4f55\u7cbe\u51c6\uff0cC\u7684\u603b\u4f53\u7cbe\u51c6\u5ea6\u4e5f\u4f1a\u56e0A\u800c\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n\n\n\n<p><strong>\u5de7\u5999\u5b9a\u4f4d<\/strong>\u3002\u6709\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u5339\u914d\u7684the\uff0c\u662f\u4f5c\u4e3a\u5355\u8bcd\u7684the\uff08\u4e24\u8fb9\u6709\u7a7a\u683c\uff09\uff0c\u800c\u4e0d\u662f\u4f5c\u4e3a\u5355\u8bcd\u4e00\u90e8\u5206\u7684t-h-e\u7684\u6709\u5e8f\u6392\u5217\uff08\u4f8b\u5982together\u4e2d\u7684the\uff09\u3002\u5728\u9002\u5f53\u7684\u65f6\u5019\u7528\u4e0a^\uff0c$\uff0c\\b\u7b49\u7b49\u5b9a\u4f4d\u951a\u70b9\uff0c\u80fd\u6709\u6548\u63d0\u5347\u627e\u5230\u6210\u529f\u5339\u914d\u3001\u6dd8\u6c70\u4e0d\u6210\u529f\u5339\u914d\u7684\u6548\u7387\u3002<\/p>\n\n\n\n<p>\u6765\u6e90\uff1ahttps:\/\/www.jb51.net\/tools\/regex.htm<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7248\u672c\uff1av0.03 (2013-5-13) \u6574\u7406\uff1adeerchao \u8bf4\u660e\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f\u901a\u5e38\u7528\u4e8e\u4e24\u79cd\u4efb\u52a1\uff1a1.\u9a8c\u8bc1\uff0c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-619","post","type-post","status-publish","format-standard","hentry","category-it"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.iur.me\/index.php?rest_route=\/wp\/v2\/posts\/619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iur.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iur.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iur.me\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iur.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=619"}],"version-history":[{"count":1,"href":"https:\/\/www.iur.me\/index.php?rest_route=\/wp\/v2\/posts\/619\/revisions"}],"predecessor-version":[{"id":688,"href":"https:\/\/www.iur.me\/index.php?rest_route=\/wp\/v2\/posts\/619\/revisions\/688"}],"wp:attachment":[{"href":"https:\/\/www.iur.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iur.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iur.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}