{"id":451,"date":"2018-04-01T00:00:04","date_gmt":"2018-03-31T16:00:04","guid":{"rendered":"https:\/\/www.wxbit.com\/?p=451"},"modified":"2019-04-24T01:53:32","modified_gmt":"2019-04-23T17:53:32","slug":"%e6%ad%a3%e5%88%99%e8%a1%a8%e8%be%be%e5%bc%8f%e6%89%8b%e5%86%8c","status":"publish","type":"post","link":"https:\/\/www.wxbit.com\/?p=451","title":{"rendered":"\u6b63\u5219\u8868\u8fbe\u5f0f\u624b\u518c"},"content":{"rendered":"<h2>\u8868\u8fbe\u5f0f\u5168\u96c6<\/h2>\n<table class=\"wikitable\">\n<tbody>\n<tr>\n<th width=\"10%\">\u5b57\u7b26<\/th>\n<th width=\"90%\">\u63cf\u8ff0<\/th>\n<\/tr>\n<tr>\n<th>\\<\/th>\n<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\u201c<code>n<\/code>\u201d\u5339\u914d\u5b57\u7b26\u201c<code>n<\/code>\u201d\u3002\u201c<code>\\n<\/code>\u201d\u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u4e32\u884c\u201c<code>\\\\<\/code>\u201d\u5339\u914d\u201c<code>\\<\/code>\u201d\u800c\u201c<code>\\(<\/code>\u201d\u5219\u5339\u914d\u201c<code>(<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>^<\/th>\n<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<code>\\n<\/code>\u201d\u6216\u201c<code>\\r<\/code>\u201d\u4e4b\u540e\u7684\u4f4d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<th>$<\/th>\n<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<code>\\n<\/code>\u201d\u6216\u201c<code>\\r<\/code>\u201d\u4e4b\u524d\u7684\u4f4d\u7f6e\u3002<\/td>\n<\/tr>\n<tr>\n<th>*<\/th>\n<td>\u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u591a\u6b21\u3002\u4f8b\u5982\uff0czo*\u80fd\u5339\u914d\u201c<code>z<\/code>\u201d\u4ee5\u53ca\u201c<code>zoo<\/code>\u201d\u3002*\u7b49\u4ef7\u4e8e{0,}\u3002<\/td>\n<\/tr>\n<tr>\n<th>+<\/th>\n<td>\u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u4e00\u6b21\u6216\u591a\u6b21\u3002\u4f8b\u5982\uff0c\u201c<code>zo+<\/code>\u201d\u80fd\u5339\u914d\u201c<code>zo<\/code>\u201d\u4ee5\u53ca\u201c<code>zoo<\/code>\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201c<code>z<\/code>\u201d\u3002+\u7b49\u4ef7\u4e8e{1,}\u3002<\/td>\n<\/tr>\n<tr>\n<th>?<\/th>\n<td>\u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u4e00\u6b21\u3002\u4f8b\u5982\uff0c\u201c<code>do(es)?<\/code>\u201d\u53ef\u4ee5\u5339\u914d\u201c<code>does<\/code>\u201d\u6216\u201c<code>does<\/code>\u201d\u4e2d\u7684\u201c<code>do<\/code>\u201d\u3002?\u7b49\u4ef7\u4e8e{0,1}\u3002<\/td>\n<\/tr>\n<tr>\n<th>{n}<\/th>\n<td>n\u662f\u4e00\u4e2a\u975e\u8d1f\u6574\u6570\u3002\u5339\u914d\u786e\u5b9a\u7684n\u6b21\u3002\u4f8b\u5982\uff0c\u201c<code>o{2}<\/code>\u201d\u4e0d\u80fd\u5339\u914d\u201c<code>Bob<\/code>\u201d\u4e2d\u7684\u201c<code>o<\/code>\u201d\uff0c\u4f46\u662f\u80fd\u5339\u914d\u201c<code>food<\/code>\u201d\u4e2d\u7684\u4e24\u4e2ao\u3002<\/td>\n<\/tr>\n<tr>\n<th>{n,}<\/th>\n<td>n\u662f\u4e00\u4e2a\u975e\u8d1f\u6574\u6570\u3002\u81f3\u5c11\u5339\u914dn\u6b21\u3002\u4f8b\u5982\uff0c\u201c<code>o{2,}<\/code>\u201d\u4e0d\u80fd\u5339\u914d\u201c<code>Bob<\/code>\u201d\u4e2d\u7684\u201c<code>o<\/code>\u201d\uff0c\u4f46\u80fd\u5339\u914d\u201c<code>foooood<\/code>\u201d\u4e2d\u7684\u6240\u6709o\u3002\u201c<code>o{1,}<\/code>\u201d\u7b49\u4ef7\u4e8e\u201c<code>o+<\/code>\u201d\u3002\u201c<code>o{0,}<\/code>\u201d\u5219\u7b49\u4ef7\u4e8e\u201c<code>o*<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>{n,m}<\/th>\n<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\u201c<code>o{1,3}<\/code>\u201d\u5c06\u5339\u914d\u201c<code>fooooood<\/code>\u201d\u4e2d\u7684\u524d\u4e09\u4e2ao\u3002\u201c<code>o{0,1}<\/code>\u201d\u7b49\u4ef7\u4e8e\u201c<code>o?<\/code>\u201d\u3002\u8bf7\u6ce8\u610f\u5728\u9017\u53f7\u548c\u4e24\u4e2a\u6570\u4e4b\u95f4\u4e0d\u80fd\u6709\u7a7a\u683c\u3002<\/td>\n<\/tr>\n<tr>\n<th>?<\/th>\n<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\u201c<code>oooo<\/code>\u201d\uff0c\u201c<code>o+?<\/code>\u201d\u5c06\u5339\u914d\u5355\u4e2a\u201c<code>o<\/code>\u201d\uff0c\u800c\u201c<code>o+<\/code>\u201d\u5c06\u5339\u914d\u6240\u6709\u201c<code>o<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>.<\/th>\n<td>\u5339\u914d\u9664\u201c<code>\\<\/code><code>n<\/code>\u201d\u4e4b\u5916\u7684\u4efb\u4f55\u5355\u4e2a\u5b57\u7b26\u3002\u8981\u5339\u914d\u5305\u62ec\u201c<code>\\<\/code><code>n<\/code>\u201d\u5728\u5185\u7684\u4efb\u4f55\u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528\u50cf\u201c<code>(.|\\n)<\/code>\u201d\u7684\u6a21\u5f0f\u3002<\/td>\n<\/tr>\n<tr>\n<th>(pattern)<\/th>\n<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<code>\\(<\/code>\u201d\u6216\u201c<code>\\)<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>(?:pattern)<\/th>\n<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<code>(|)<\/code>\u201d\u6765\u7ec4\u5408\u4e00\u4e2a\u6a21\u5f0f\u7684\u5404\u4e2a\u90e8\u5206\u662f\u5f88\u6709\u7528\u3002\u4f8b\u5982\u201c<code>industr(?:y|ies)<\/code>\u201d\u5c31\u662f\u4e00\u4e2a\u6bd4\u201c<code>industry|industries<\/code>\u201d\u66f4\u7b80\u7565\u7684\u8868\u8fbe\u5f0f\u3002<\/td>\n<\/tr>\n<tr>\n<th>(?=pattern)<\/th>\n<td>\u6b63\u5411\u80af\u5b9a\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\u201c<code>Windows(?=95|98|NT|2000)<\/code>\u201d\u80fd\u5339\u914d\u201c<code>Windows2000<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201c<code>Windows3.1<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\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>\n<\/tr>\n<tr>\n<th>(?!pattern)<\/th>\n<td>\u6b63\u5411\u5426\u5b9a\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\u201c<code>Windows(?!95|98|NT|2000)<\/code>\u201d\u80fd\u5339\u914d\u201c<code>Windows3.1<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201c<code>Windows2000<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\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>\n<\/tr>\n<tr>\n<th>(?&lt;=pattern)<\/th>\n<td>\u53cd\u5411\u80af\u5b9a\u9884\u67e5\uff0c\u4e0e\u6b63\u5411\u80af\u5b9a\u9884\u67e5\u7c7b\u62df\uff0c\u53ea\u662f\u65b9\u5411\u76f8\u53cd\u3002\u4f8b\u5982\uff0c\u201c<code>(?&lt;=95|98|NT|2000)Windows<\/code>\u201d\u80fd\u5339\u914d\u201c<code>2000Windows<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201c<code>3.1Windows<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>(?&lt;!pattern)<\/th>\n<td>\u53cd\u5411\u5426\u5b9a\u9884\u67e5\uff0c\u4e0e\u6b63\u5411\u5426\u5b9a\u9884\u67e5\u7c7b\u62df\uff0c\u53ea\u662f\u65b9\u5411\u76f8\u53cd\u3002\u4f8b\u5982\u201c<code>(?&lt;!95|98|NT|2000)Windows<\/code>\u201d\u80fd\u5339\u914d\u201c<code>3.1Windows<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201c<code>2000Windows<\/code>\u201d\u4e2d\u7684\u201c<code>Windows<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>x|y<\/th>\n<td>\u5339\u914dx\u6216y\u3002\u4f8b\u5982\uff0c\u201c<code>z|food<\/code>\u201d\u80fd\u5339\u914d\u201c<code>z<\/code>\u201d\u6216\u201c<code>food<\/code>\u201d\u3002\u201c<code>(z|f)ood<\/code>\u201d\u5219\u5339\u914d\u201c<code>zood<\/code>\u201d\u6216\u201c<code>food<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>[xyz]<\/th>\n<td>\u5b57\u7b26\u96c6\u5408\u3002\u5339\u914d\u6240\u5305\u542b\u7684\u4efb\u610f\u4e00\u4e2a\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u201c<code>[abc]<\/code>\u201d\u53ef\u4ee5\u5339\u914d\u201c<code>plain<\/code>\u201d\u4e2d\u7684\u201c<code>a<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>[^xyz]<\/th>\n<td>\u8d1f\u503c\u5b57\u7b26\u96c6\u5408\u3002\u5339\u914d\u672a\u5305\u542b\u7684\u4efb\u610f\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u201c<code>[^abc]<\/code>\u201d\u53ef\u4ee5\u5339\u914d\u201c<code>plain<\/code>\u201d\u4e2d\u7684\u201c<code>p<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>[a-z]<\/th>\n<td>\u5b57\u7b26\u8303\u56f4\u3002\u5339\u914d\u6307\u5b9a\u8303\u56f4\u5185\u7684\u4efb\u610f\u5b57\u7b26\u3002\u4f8b\u5982\uff0c\u201c<code>[a-z]<\/code>\u201d\u53ef\u4ee5\u5339\u914d\u201c<code>a<\/code>\u201d\u5230\u201c<code>z<\/code>\u201d\u8303\u56f4\u5185\u7684\u4efb\u610f\u5c0f\u5199\u5b57\u6bcd\u5b57\u7b26\u3002<\/td>\n<\/tr>\n<tr>\n<th>[^a-z]<\/th>\n<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<code>[^a-z]<\/code>\u201d\u53ef\u4ee5\u5339\u914d\u4efb\u4f55\u4e0d\u5728\u201c<code>a<\/code>\u201d\u5230\u201c<code>z<\/code>\u201d\u8303\u56f4\u5185\u7684\u4efb\u610f\u5b57\u7b26\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\b<\/th>\n<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\u201c<code>er\\b<\/code>\u201d\u53ef\u4ee5\u5339\u914d\u201c<code>never<\/code>\u201d\u4e2d\u7684\u201c<code>er<\/code>\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201c<code>verb<\/code>\u201d\u4e2d\u7684\u201c<code>er<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\B<\/th>\n<td>\u5339\u914d\u975e\u5355\u8bcd\u8fb9\u754c\u3002\u201c<code>er\\B<\/code>\u201d\u80fd\u5339\u914d\u201c<code>verb<\/code>\u201d\u4e2d\u7684\u201c<code>er<\/code>\u201d\uff0c\u4f46\u4e0d\u80fd\u5339\u914d\u201c<code>never<\/code>\u201d\u4e2d\u7684\u201c<code>er<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\cx<\/th>\n<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\u201c<code>c<\/code>\u201d\u5b57\u7b26\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\d<\/th>\n<td>\u5339\u914d\u4e00\u4e2a\u6570\u5b57\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e[0-9]\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\D<\/th>\n<td>\u5339\u914d\u4e00\u4e2a\u975e\u6570\u5b57\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e[^0-9]\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\f<\/th>\n<td>\u5339\u914d\u4e00\u4e2a\u6362\u9875\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0c\u548c\\cL\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\n<\/th>\n<td>\u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0a\u548c\\cJ\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\r<\/th>\n<td>\u5339\u914d\u4e00\u4e2a\u56de\u8f66\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0d\u548c\\cM\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\s<\/th>\n<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>\n<\/tr>\n<tr>\n<th>\\S<\/th>\n<td>\u5339\u914d\u4efb\u4f55\u975e\u7a7a\u767d\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e[^ \\f\\n\\r\\t\\v]\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\t<\/th>\n<td>\u5339\u914d\u4e00\u4e2a\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e\\x09\u548c\\cI\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\v<\/th>\n<td>\u5339\u914d\u4e00\u4e2a\u5782\u76f4\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e\\x0b\u548c\\cK\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\w<\/th>\n<td>\u5339\u914d\u5305\u62ec\u4e0b\u5212\u7ebf\u7684\u4efb\u4f55\u5355\u8bcd\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e\u201c<code>[A-Za-z0-9_]<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\W<\/th>\n<td>\u5339\u914d\u4efb\u4f55\u975e\u5355\u8bcd\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e\u201c<code>[^A-Za-z0-9_]<\/code>\u201d\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\xn<\/th>\n<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<code>\\x41<\/code>\u201d\u5339\u914d\u201c<code>A<\/code>\u201d\u3002\u201c<code>\\x041<\/code>\u201d\u5219\u7b49\u4ef7\u4e8e\u201c<code>\\x04&amp;1<\/code>\u201d\u3002\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u53ef\u4ee5\u4f7f\u7528ASCII\u7f16\u7801\u3002.<\/td>\n<\/tr>\n<tr>\n<th>\\num<\/th>\n<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<code>(.)\\1<\/code>\u201d\u5339\u914d\u4e24\u4e2a\u8fde\u7eed\u7684\u76f8\u540c\u5b57\u7b26\u3002<\/td>\n<\/tr>\n<tr>\n<th>\\n<\/th>\n<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>\n<\/tr>\n<tr>\n<th>\\nm<\/th>\n<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>\n<\/tr>\n<tr>\n<th>\\nml<\/th>\n<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>\n<\/tr>\n<tr>\n<th>\\un<\/th>\n<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\u00a9\uff09\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<h2>\u5e38\u7528\u6b63\u5219\u8868\u8fbe\u5f0f<\/h2>\n<table class=\"wikitable\" width=\"100%\">\n<tbody>\n<tr>\n<th width=\"10%\">\u7528\u6237\u540d<\/th>\n<td width=\"90%\">\/^[a-z0-9_-]{3,16}$\/<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">\u5bc6\u7801<\/th>\n<td>\/^[a-z0-9_-]{6,18}$\/<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">\u5341\u516d\u8fdb\u5236\u503c<\/th>\n<td>\/^#?([a-f0-9]{6}|[a-f0-9]{3})$\/<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">\u7535\u5b50\u90ae\u7bb1<\/th>\n<td>\/^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$\/<br \/>\n\/^[a-z\\d]+(\\.[a-z\\d]+)*@([\\da-z](-[\\da-z])?)+(\\.{1,2}[a-z]+)+$\/<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">URL<\/th>\n<td>\/^(https?:\\\/\\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\\/\\w \\.-]*)*\\\/?$\/<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">IP \u5730\u5740<\/th>\n<td>\/((2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\\.){3}(2[0-4]\\d|25[0-5]|[01]?\\d\\d?)\/<br \/>\n\/^(?:(?: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>\n<\/tr>\n<tr>\n<th scope=\"row\">HTML \u6807\u7b7e<\/th>\n<td>\/^&lt;([a-z]+)([^&lt;]+)*(?:&gt;(.*)&lt;\\\/\\1&gt;|\\s+\\\/&gt;)$\/<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">\u5220\u9664\u4ee3\u7801\\\\\u6ce8\u91ca<\/th>\n<td>(?&lt;!http:|\\S)\/\/.*$<\/td>\n<\/tr>\n<tr>\n<th scope=\"row\">Unicode\u7f16\u7801\u4e2d\u7684\u6c49\u5b57\u8303\u56f4<\/th>\n<td>\/^[\\u2E80-\\u9FFF]+$\/<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>\u8868\u8fbe\u5f0f\u5168\u96c6 \u5b57\u7b26 \u63cf\u8ff0 \\ \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\u4e32\u884c\u201c\\\\\u201d\u5339\u914d\u201c\\\u201d\u800c\u201c\\(\u201d\u5219\u5339\u914d\u201c(\u201d\u3002 ^ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u5f00\u59cb\u4f4d\u7f6e\u3002\u5982\u679c\u8bbe\u7f6e\u4e86RegE &hellip; <a href=\"https:\/\/www.wxbit.com\/?p=451\">\u9605\u8bfb\u5168\u6587 <i class=\"fa fa-share-square-o\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-451","post","type-post","status-publish","format-standard","hentry","category-others"],"_links":{"self":[{"href":"https:\/\/www.wxbit.com\/index.php?rest_route=\/wp\/v2\/posts\/451","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wxbit.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wxbit.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wxbit.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wxbit.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=451"}],"version-history":[{"count":1,"href":"https:\/\/www.wxbit.com\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions"}],"predecessor-version":[{"id":452,"href":"https:\/\/www.wxbit.com\/index.php?rest_route=\/wp\/v2\/posts\/451\/revisions\/452"}],"wp:attachment":[{"href":"https:\/\/www.wxbit.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wxbit.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wxbit.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}