{"id":122,"date":"2026-06-13T13:31:16","date_gmt":"2026-06-13T05:31:16","guid":{"rendered":"https:\/\/99website.top\/blog\/?p=122"},"modified":"2026-06-13T13:39:08","modified_gmt":"2026-06-13T05:39:08","slug":"%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e5%9f%ba%e6%9c%ac%e8%af%ad%e6%b3%95%e7%ae%80%e4%bb%8b","status":"publish","type":"post","link":"https:\/\/99website.top\/blog\/?p=122","title":{"rendered":"\u6b63\u5219\u8868\u8fbe\u5f0f\u57fa\u672c\u8bed\u6cd5\u7b80\u4ecb"},"content":{"rendered":"<h2>\u4e00\u3001\u5143\u5b57\u7b26\uff08\u7279\u6b8a\u7b26\u53f7\uff0c\u5339\u914d\u7279\u6b8a\u542b\u4e49\uff09<\/h2>\n<h3>1. \u5339\u914d\u4f4d\u7f6e\uff08\u4e0d\u5360\u5b57\u7b26\uff0c\u53ea\u5b9a\u4f4d\uff09<\/h3>\n<div class=\"table-responsive\"><table class=\"table\" >\n<thead>\n<tr>\n<th align=\"left\">\u7b80\u5199<\/th>\n<th align=\"left\">\u7b49\u4ef7<\/th>\n<th align=\"left\">\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>\\d<\/code><\/td>\n<td align=\"left\"><code>[0-9]<\/code><\/td>\n<td align=\"left\">\u6570\u5b57<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\D<\/code><\/td>\n<td align=\"left\"><code>[^0-9]<\/code><\/td>\n<td align=\"left\">\u975e\u6570\u5b57<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\w<\/code><\/td>\n<td align=\"left\"><code>[a-zA-Z0-9_]<\/code><\/td>\n<td align=\"left\">\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\W<\/code><\/td>\n<td align=\"left\"><code>[^a-zA-Z0-9_]<\/code><\/td>\n<td align=\"left\">\u975e\u5355\u8bcd\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\s<\/code><\/td>\n<td align=\"left\"><code>[ \\t\\n\\r]<\/code><\/td>\n<td align=\"left\">\u7a7a\u767d\uff08\u7a7a\u683c\u3001\u5236\u8868\u3001\u6362\u884c\uff09<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\S<\/code><\/td>\n<td align=\"left\"><code>[^ \\t\\n\\r]<\/code><\/td>\n<td align=\"left\">\u975e\u7a7a\u767d\u5b57\u7b26<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<hr \/>\n<h3>2. \u5339\u914d\u4efb\u610f \/ \u9650\u5b9a\u5b57\u7b26<\/h3>\n<div class=\"table-responsive\"><table class=\"table\" >\n<thead>\n<tr>\n<th align=\"left\">\u7b26\u53f7<\/th>\n<th align=\"left\">\u4f5c\u7528<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>.<\/code><\/td>\n<td align=\"left\">\u5339\u914d\u4efb\u610f\u5355\u4e2a\u5b57\u7b26\uff08\u4e0d\u542b\u6362\u884c\uff09<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>[]<\/code><\/td>\n<td align=\"left\">\u5b57\u7b26\u96c6\uff0c\u5339\u914d\u62ec\u53f7\u5185\u4efb\u610f\u4e00\u4e2a<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>[^]<\/code><\/td>\n<td align=\"left\">\u53d6\u53cd\u5b57\u7b26\u96c6\uff0c\u5339\u914d\u4e0d\u5728\u62ec\u53f7\u5185\u7684\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\|<\/code><\/td>\n<td align=\"left\">\u6216\uff0c\u5206\u9694\u591a\u4e2a\u5339\u914d\u89c4\u5219<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>()<\/code><\/td>\n<td align=\"left\">\u5206\u7ec4\uff0c\u6355\u83b7\u5185\u5bb9\uff1b\u4e5f\u53ef\u6574\u4f53\u9650\u5b9a\u91cd\u590d<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<hr \/>\n<h3>3. \u91cd\u590d\u91cf\u8bcd\uff08\u4fee\u9970\u524d\u9762 1 \u4e2a \/ \u4e00\u7ec4\u5b57\u7b26\u51fa\u73b0\u6b21\u6570\uff09<\/h3>\n<div class=\"table-responsive\"><table class=\"table\" >\n<thead>\n<tr>\n<th align=\"left\">\u7b26\u53f7<\/th>\n<th align=\"left\">\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>*<\/code><\/td>\n<td align=\"left\">0 \u6b21\u30011 \u6b21\u3001\u591a\u6b21\uff08<span class=\"katex math inline\">\\ge 0<\/span>\uff09<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>+<\/code><\/td>\n<td align=\"left\">\u81f3\u5c11 1 \u6b21\uff08<span class=\"katex math inline\">\\ge 1<\/span>\uff09<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>?<\/code><\/td>\n<td align=\"left\">0 \u6b21\u6216 1 \u6b21\uff080\/1\uff09\uff1b\u7d27\u8ddf\u91cf\u8bcd\u540e = \u975e\u8d2a\u5a6a<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>{n}<\/code><\/td>\n<td align=\"left\">\u56fa\u5b9a <span class=\"katex math inline\">n<\/span> \u6b21<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>{n,}<\/code><\/td>\n<td align=\"left\">\u81f3\u5c11 <span class=\"katex math inline\">n<\/span> \u6b21<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>{n,m}<\/code><\/td>\n<td align=\"left\">$n \\sim m$ \u6b21\uff08\u5305\u542b\u4e24\u7aef\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<hr \/>\n<h3>4. \u8f6c\u4e49\u7b26\u53f7 <code>\\<\/code><\/h3>\n<p>\u628a\u5143\u5b57\u7b26\u53d8\u56de\u666e\u901a\u5b57\u7b26\uff1a<code>\\.<\/code> \u5339\u914d\u70b9\u3001<code>\\*<\/code> \u5339\u914d\u661f\u53f7\u3001<code>\\(<\/code> \u5339\u914d\u62ec\u53f7\u3002<\/p>\n<h4>\u9884\u5b9a\u4e49\u7b80\u5199\u5b57\u7b26\u7c7b\uff08\u5e38\u7528\uff09<\/h4>\n<div class=\"table-responsive\"><table class=\"table\" >\n<thead>\n<tr>\n<th align=\"left\">\u7b80\u5199<\/th>\n<th align=\"left\">\u7b49\u4ef7<\/th>\n<th align=\"left\">\u542b\u4e49<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td align=\"left\"><code>\\d<\/code><\/td>\n<td align=\"left\"><code>[0-9]<\/code><\/td>\n<td align=\"left\">\u6570\u5b57<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\D<\/code><\/td>\n<td align=\"left\"><code>[^0-9]<\/code><\/td>\n<td align=\"left\">\u975e\u6570\u5b57<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\w<\/code><\/td>\n<td align=\"left\"><code>[a-zA-Z0-9_]<\/code><\/td>\n<td align=\"left\">\u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\W<\/code><\/td>\n<td align=\"left\"><code>[^a-zA-Z0-9_]<\/code><\/td>\n<td align=\"left\">\u975e\u5355\u8bcd\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\s<\/code><\/td>\n<td align=\"left\"><code>[ \\t\\n\\r]<\/code><\/td>\n<td align=\"left\">\u7a7a\u767d\uff08\u7a7a\u683c\u3001\u5236\u8868\u3001\u6362\u884c\uff09<\/td>\n<\/tr>\n<tr>\n<td align=\"left\"><code>\\S<\/code><\/td>\n<td align=\"left\"><code>[^ \\t\\n\\r]<\/code><\/td>\n<td align=\"left\">\u975e\u7a7a\u767d\u5b57\u7b26<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/div>\n<hr \/>\n<h2>\u4e8c\u3001\u5b57\u7b26\u96c6 <code>[]<\/code><\/h2>\n<ul>\n<li><strong>\u8303\u56f4\u7b80\u5199<\/strong>\uff1a<code>[0-9]<\/code>\u3001<code>[a-z]<\/code>\u3001<code>[A-Za-z0-9]<\/code><\/li>\n<li><strong>\u62ec\u53f7\u5185\u591a\u6570\u5143\u5b57\u7b26\u5931\u6548<\/strong>\uff1a<code>[.*+?]<\/code> \u5728\u4e2d\u62ec\u53f7\u5185\u76f4\u63a5\u5339\u914d\u7b26\u53f7\u672c\u8eab\uff0c\u4e0d\u9700\u8981\u52a0\u8f6c\u4e49\u3002<\/li>\n<li><strong>\u8131\u5b57\u7b26\u4f4d\u7f6e<\/strong>\uff1a\u8131\u5b57\u7b26\u653e\u6700\u524d\u624d\u662f\u53d6\u53cd <code>[^a-z]<\/code>\uff1b\u5982\u679c\u653e\u4e2d\u95f4\uff08\u5982 <code>[a^z]<\/code>\uff09\u53ea\u662f\u666e\u901a\u7b26\u53f7\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e09\u3001\u5206\u7ec4\u4e0e\u6355\u83b7<\/h2>\n<ul>\n<li><strong><code>(\u5185\u5bb9)<\/code><\/strong>\uff1a\u6355\u83b7\u5206\u7ec4\uff0c\u5339\u914d\u540e\u53ef\u63d0\u53d6\u5206\u7ec4\u5185\u5bb9\u3001\u53cd\u5411\u5f15\u7528\u3002<\/li>\n<li><strong>\u53cd\u5411\u5f15\u7528<\/strong>\uff1a<code>\\1<\/code> \u4ee3\u8868\u7b2c 1 \u4e2a\u62ec\u53f7\u5339\u914d\u5230\u7684\u6587\u672c\u3002<\/li>\n<li><strong><code>(?:\u5185\u5bb9)<\/code><\/strong>\uff1a\u975e\u6355\u83b7\u5206\u7ec4\uff0c\u53ea\u5206\u7ec4\u4e0d\u4fdd\u5b58\uff0c\u8282\u7701\u8fd0\u884c\u6027\u80fd\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u56db\u3001\u8d2a\u5a6a vs \u975e\u8d2a\u5a6a<\/h2>\n<ul>\n<li><strong>\u9ed8\u8ba4\u8d2a\u5a6a<\/strong>\uff1a\u5c3d\u53ef\u80fd\u5339\u914d\u6700\u957f\u7684\u6587\u672c\u3002\u4f8b\u5982 <code>a.*b<\/code> \u5339\u914d <code>a1b2b<\/code> \u7684\u5168\u90e8\u7ed3\u679c\u3002<\/li>\n<li><strong>\u975e\u8d2a\u5a6a\uff08\u52a0 <code>?<\/code>\uff09<\/strong>\uff1a\u6700\u77ed\u5339\u914d\u3002\u4f8b\u5982 <code>a.*?b<\/code> \u53ea\u5339\u914d <code>a1b<\/code>\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e94\u3001\u5e38\u7528\u4fee\u9970\u7b26\uff08\u5199\u5728\u6b63\u5219\u5916\u4fa7\uff09<\/h2>\n<ul>\n<li><code>g<\/code>\uff1a\u5168\u5c40\u5339\u914d\uff0c\u627e\u5230\u5168\u90e8\u7ed3\u679c\uff08\u4e0d\u505c\u6b62\u5728\u7b2c\u4e00\u4e2a\uff09\u3002<\/li>\n<li><code>i<\/code>\uff1a\u5ffd\u7565\u5927\u5c0f\u5199\u3002<\/li>\n<li><code>m<\/code>\uff1a\u591a\u884c\u6a21\u5f0f\uff0c\u4f7f <code>^<\/code> \u548c <code>$<\/code> \u80fd\u591f\u5339\u914d\u6bcf\u884c\u7684\u9996\u5c3e\u3002<\/li>\n<li><code>s<\/code>\uff1a\u5355\u884c\u6a21\u5f0f\uff0c\u4f7f\u70b9\u53f7 <code>.<\/code> \u53ef\u4ee5\u5339\u914d\u6362\u884c\u7b26\u3002<\/li>\n<\/ul>\n<hr \/>\n<h2>\u516d\u3001\u6700\u7b80\u793a\u4f8b\uff08\u65b9\u4fbf\u7406\u89e3\uff09<\/h2>\n<ul>\n<li><strong>\u624b\u673a\u53f7\u7b80\u5355\u5339\u914d<\/strong>\uff1a<code>^1[3-9]\\d{9}$<\/code><\/li>\n<li><strong>\u90ae\u7bb1\u7b80\u6613\u5339\u914d<\/strong>\uff1a<code>^\\w+@\\w+\\.\\w+$<\/code><\/li>\n<li><strong>\u7eaf\u6570\u5b57\u9a8c\u8bc1<\/strong>\uff1a<code>^\\d+$<\/code><\/li>\n<li><strong>\u5339\u914d\u5c0f\u6570<\/strong>\uff1a<code>^\\d+(\\.\\d+)?$<\/code><\/li>\n<\/ul>\n<hr \/>\n<h2>\u4e03\u3001\u907f\u5751\u8981\u70b9<\/h2>\n<blockquote>\n<ol>\n<li><code>.<\/code> \u9ed8\u8ba4\u4e0d\u5339\u914d\u6362\u884c\uff0c\u9700\u8981\u5339\u914d\u6362\u884c\u65f6\u8bb0\u5f97\u5f00\u542f <code>s<\/code> \u4fee\u9970\u7b26\u3002<\/li>\n<li><code>?<\/code> \u6709\u4e24\u4e2a\u4f5c\u7528\uff1a\u4f5c\u4e3a\u91cf\u8bcd\u65f6\u4ee3\u8868\u201c0\u6b21\u62161\u6b21\u201d\uff0c\u7d27\u8ddf\u5176\u4ed6\u91cf\u8bcd\u540e\u65f6\u4ee3\u8868\u201c\u975e\u8d2a\u5a6a\u201d\uff0c\u6ce8\u610f\u533a\u5206\u573a\u666f\u3002<\/li>\n<li>\u8def\u5f84\u659c\u6760\u3001\u5c0f\u6570\u70b9\u3001\u62ec\u53f7\u3001\u661f\u53f7\u5728\u4f5c\u4e3a\u666e\u901a\u5b57\u7b26\u5339\u914d\u65f6\uff0c\u5fc5\u987b\u7528 <code>\\<\/code> \u8fdb\u884c\u8f6c\u4e49\u3002<\/li>\n<li><code>^<\/code> \u548c <code>$<\/code> \u5982\u679c\u4e0d\u52a0\uff0c\u4f1a\u5339\u914d\u5230\u201c\u5305\u542b\u8be5\u89c4\u5219\u201d\u7684\u6a21\u7cca\u5b57\u7b26\u4e32\uff1b\u52a0\u4e0a\u624d\u662f\u4ece\u5934\u5230\u5c3e\u7684\u201c\u7cbe\u786e\u5339\u914d\u201d\u3002<\/li>\n<li>\u7ee7\u7eed\u52a0\u6cb9\u5427\uff01<\/li>\n<\/ol>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u5143\u5b57\u7b26\uff08\u7279\u6b8a\u7b26\u53f7\uff0c\u5339\u914d\u7279\u6b8a\u542b\u4e49\uff09 1. \u5339\u914d\u4f4d\u7f6e\uff08\u4e0d\u5360\u5b57\u7b26\uff0c\u53ea\u5b9a\u4f4d\uff09 \u7b80\u5199 \u7b49\u4ef7 \u542b\u4e49 \\d [0-9] \u6570\u5b57 \\D [^0-9] \u975e\u6570\u5b57 \\w [a-zA-Z0-9_] \u5b57\u6bcd\u3001\u6570\u5b57\u3001\u4e0b\u5212\u7ebf \\W [^a-zA-Z0-9_] \u975e\u5355\u8bcd\u5b57\u7b26 \\s [ \\t\\n\\r] \u7a7a\u767d\uff08\u7a7a\u683c\u3001\u5236\u8868\u3001\u6362\u884c\uff09 \\S [^ \\t\\n\\r] \u975e\u7a7a\u767d\u5b57\u7b26 2. \u5339\u914d\u4efb\u610f \/ \u9650\u5b9a\u5b57\u7b26 \u7b26\u53f7 \u4f5c\u7528 . \u5339\u914d\u4efb\u610f\u5355\u4e2a\u5b57\u7b26\uff08\u4e0d [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/99website.top\/blog\/index.php?rest_route=\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/99website.top\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/99website.top\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/99website.top\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/99website.top\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=122"}],"version-history":[{"count":4,"href":"https:\/\/99website.top\/blog\/index.php?rest_route=\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":126,"href":"https:\/\/99website.top\/blog\/index.php?rest_route=\/wp\/v2\/posts\/122\/revisions\/126"}],"wp:attachment":[{"href":"https:\/\/99website.top\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/99website.top\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/99website.top\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}