{"id":7648,"date":"2025-01-24T09:00:37","date_gmt":"2025-01-24T09:00:37","guid":{"rendered":"https:\/\/howtogeek.blog\/zh\/?p=7648"},"modified":"2025-01-24T09:00:37","modified_gmt":"2025-01-24T09:00:37","slug":"a-comprehensive-guide-to-using-regex-functions-in-excel","status":"publish","type":"post","link":"https:\/\/howtogeek.blog\/zh\/a-comprehensive-guide-to-using-regex-functions-in-excel\/","title":{"rendered":"\u5728 Excel \u4e2d\u4f7f\u7528 REGEX \u51fd\u6578\u7684\u7d9c\u5408\u6307\u5357"},"content":{"rendered":"<p>2024 \u5e74\uff0c\u5fae\u8edf\u900f\u904e\u5f15\u5165\u4ee5\u6b63\u898f\u8868\u793a\u5f0f (REGEX) \u70ba\u4e2d\u5fc3\u7684\u4e09\u500b\u5f37\u5927\u529f\u80fd\u4f86\u63d0\u5347 Excel \u7684\u529f\u80fd\u3002\u9019\u4e9b\u51fd\u6578\uff08\u5373 REGEXTEST\u3001REGEXEXTRACT \u548c REGEXREPLACE\uff09\u4f7f\u7528\u6236\u80fd\u5920\u6709\u6548\u5730\u8b58\u5225\u3001\u63d0\u53d6\u548c\u66ff\u63db\u8907\u96dc\u7684\u8cc7\u6599\u6a21\u5f0f\u3002\u5b83\u5011\u53ef\u4ee5\u5728 Excel Web \u7248\u672c\u548c Microsoft 365 \u4e2d\u8a2a\u554f\uff0c\u5f9e\u800c\u986f\u8457\u589e\u5f37\u4f7f\u7528\u8005\u7684\u8cc7\u6599\u64cd\u4f5c\u3002<\/p>\n<h2 id=\"introduction-to-regex\">\u4e86\u89e3 Excel \u4e2d\u7684 REGEX \u51fd\u6578<\/h2>\n<p>\u6b63\u898f\u8868\u793a\u5f0f\u662f\u5f62\u6210\u641c\u5c0b\u6a21\u5f0f\u7684\u5b57\u5143\u5e8f\u5217\uff0c\u6709\u52a9\u65bc\u8a73\u7d30\u7684\u8cc7\u6599\u5206\u6790\u3002\u9019\u4e9b\u51fd\u6578\u6539\u8b8a\u4e86 Excel \u4f7f\u7528\u8005\u8207\u5176\u8cc7\u6599\u96c6\u4e92\u52d5\u7684\u65b9\u5f0f\uff0c\u4f7f\u8cc7\u6599\u9a57\u8b49\u3001\u63d0\u53d6\u548c\u4fee\u6539\u7b49\u4efb\u52d9\u8b8a\u5f97\u66f4\u7c21\u55ae\u3001\u66f4\u76f4\u89c0\u3002<\/p>\n<h2 id=\"using-the-regextest-function\">\u5229\u7528 REGEXTEST \u51fd\u6578<\/h2>\n<p>REGEXTEST \u51fd\u6578\u53ef\u5075\u6e2c\u4e00\u6bb5\u6587\u5b57\u4e2d\u662f\u5426\u5b58\u5728\u6307\u5b9a\u6a21\u5f0f\uff0c\u4e26\u7522\u751f TRUE \u6216 FALSE \u8f38\u51fa\u3002\u8a72\u51fd\u6578\u7684\u8a9e\u6cd5\u662f<code>REGEXTEST(value, pattern, [case_sensitive])<\/code>.\u9019\u88e1\uff0c<code>value<\/code>\u662f\u8981\u6e2c\u8a66\u7684\u76ee\u6a19\u6587\u672c\uff0c<code>pattern<\/code>\u662f\u8981\u5c0b\u627e\u7684 REGEX \u6a21\u5f0f\uff0c\u5340\u5206\u5927\u5c0f\u5beb\u7684\u53c3\u6578\u662f\u53ef\u9078\u7684\u3002<\/p>\n<ul>\n<li>\u4f8b\u5982\uff0c\u8b93\u6211\u5011\u5206\u6790\u5305\u542b\u7522\u54c1\u6216\u5e33\u6236\u4ee3\u78bc\u7684 Excel \u5de5\u4f5c\u8868\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u7522\u54c1\u7a0b\u5f0f\u78bc\u7bc4\u4f8b\" class=\"wp-image\" decoding=\"async\" height=\"456\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-437-1.webp\" title=\"\u7522\u54c1\u7a0b\u5f0f\u78bc\u7bc4\u4f8b\" width=\"811\"\/><\/figure>\n<ul>\n<li>\u82e5\u8981\u9a57\u8b49\u7a0b\u5f0f\u78bc\u662f\u5426\u5305\u542b\u4efb\u4f55\u6578\u5b57\uff0c\u8acb\u6309\u4e00\u4e0b\u5132\u5b58\u683c C4 \u4e26\u8f38\u5165\uff1a<code>=REGEXTEST(A4, \"[0-9]\")<\/code>\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u5728\u5132\u5b58\u683c C4 \u4e2d\u8f38\u5165 REGEXTEST\" class=\"wp-image\" decoding=\"async\" height=\"446\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-438-1.webp\" title=\"\u5728\u5132\u5b58\u683c C4 \u4e2d\u8f38\u5165 REGEXTEST\" width=\"792\"\/><\/figure>\n<ul>\n<li>\u5982\u679c\u7a0b\u5f0f\u78bc\u4e2d\u5b58\u5728\u4efb\u4f55\u6578\u5b57\uff0c\u8f38\u51fa\u5c07\u986f\u793a\u300cTRUE\u300d\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"REGEXTEST TRUE \u7684\u8f38\u51fa\" class=\"wp-image\" decoding=\"async\" height=\"476\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-439-1.webp\" title=\"REGEXTEST TRUE \u7684\u8f38\u51fa\" width=\"846\"\/><\/figure>\n<ul>\n<li>\u82e5\u8981\u5728\u5176\u4ed6\u55ae\u5143\u683c\u4e2d\u8907\u88fd\u6b64\u64cd\u4f5c\uff0c\u8acb\u6293\u4f4f\u516c\u5f0f\u55ae\u5143\u683c\u4e00\u89d2\u7684\u586b\u5145\u624b\u67c4\u4e26\u5c07\u5176\u5411\u4e0b\u62d6\u66f3\u4ee5\u81ea\u52d5\u586b\u5145\u76f8\u9130\u55ae\u5143\u683c\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u5411\u4e0b\u62d6\u66f3\u516c\u5f0f\u4ee5\u586b\u5145\u5132\u5b58\u683c\" class=\"wp-image\" decoding=\"async\" height=\"430\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-440-1.webp\" title=\"\u5411\u4e0b\u62d6\u66f3\u516c\u5f0f\u4ee5\u586b\u5145\u5132\u5b58\u683c\" width=\"764\"\/><\/figure>\n<ul>\n<li>\u82e5\u8981\u6aa2\u67e5\u96fb\u8a71\u865f\u78bc\uff0c\u8acb\u4f7f\u7528\uff1a<code>=REGEXTEST(A4, \"\\(?\\d{3}\\)?[-.\\s]?\\d{4}\")<\/code>\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u96fb\u8a71\u865f\u78bc REGEXTEST\" class=\"wp-image\" decoding=\"async\" height=\"478\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-443-1.webp\" title=\"\u96fb\u8a71\u865f\u78bc REGEXTEST\" width=\"849\"\/><\/figure>\n<ul>\n<li>\u548c\u4ee5\u524d\u4e00\u6a23\uff0c\u62d6\u66f3\u624b\u67c4\u4ee5\u61c9\u7528\u5230\u5176\u4ed6\u55ae\u5143\u683c\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u7528\u65bc\u96fb\u8a71\u865f\u78bc\u6aa2\u67e5\u7684\u62d6\u66f3\u9078\u9805\" class=\"wp-image\" decoding=\"async\" height=\"455\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-444-1.webp\" title=\"\u7528\u65bc\u96fb\u8a71\u865f\u78bc\u6aa2\u67e5\u7684\u62d6\u66f3\u9078\u9805\" width=\"809\"\/><\/figure>\n<h2 id=\"using-the-regexextract-function\">\u4f7f\u7528 REGEXEXTRACT \u63d0\u53d6\u6587\u672c<\/h2>\n<p>REGEXEXTRACT \u51fd\u6578\u5c08\u9580\u7528\u65bc\u5f9e\u7d66\u5b9a\u503c\u4e2d\u63d0\u53d6\u7279\u5b9a\u6587\u5b57\u6bb5\u3002\u5b83\u7684\u8a9e\u6cd5\u662f<code>REGEXEXTRACT(value, pattern, [first_match], [all_matches], [case_sensitive])<\/code>.\u5728\u9019\u88e1\uff0c\u60a8\u6307\u5b9a<code>value<\/code>\u8981\u5f9e\u4e2d\u63d0\u53d6\u7684\u5167\u5bb9\uff0c\u4e26<code>pattern<\/code>\u6982\u8ff0\u8981\u63d0\u53d6\u7684\u5167\u5bb9\u3002\u53ef\u9078\u53c3\u6578\u5141\u8a31\u4f7f\u7528\u8005\u9078\u64c7\u50c5\u67e5\u627e\u7b2c\u4e00\u500b\u5339\u914d\u9805\u9084\u662f\u67e5\u627e\u6240\u6709\u5339\u914d\u9805\uff0c\u4ee5\u53ca\u641c\u5c0b\u662f\u5426\u5340\u5206\u5927\u5c0f\u5beb\u3002<\/p>\n<ul>\n<li>\u7e7c\u7e8c\u6211\u5011\u4e4b\u524d\u7684\u7bc4\u4f8b\uff0c\u6211\u5011\u53ef\u4ee5\u7121\u7e2b\u6aa2\u7d22\u96fb\u8a71\u865f\u78bc\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"REGEXEXTRACT \u7684\u4f7f\u7528\u7bc4\u4f8b\" class=\"wp-image\" decoding=\"async\" height=\"439\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-445-1.webp\" title=\"REGEXEXTRACT \u7684\u4f7f\u7528\u7bc4\u4f8b\" width=\"780\"\/><\/figure>\n<ul>\n<li>\u82e5\u8981\u64f7\u53d6\u96fb\u8a71\u865f\u78bc\uff0c\u8acb<code>=REGEXEXTRACT(A4, \"(\\\\d{3})?[-.\\s]?\\\\d{3}[-.\\s]?\\\\d{4}\")<\/code>\u5728\u5132\u5b58\u683c C4 \u4e2d\u4f7f\u7528\uff1a\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"REGEXEXTRACT \u7684\u8f38\u5165\" class=\"wp-image\" decoding=\"async\" height=\"517\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-446-1.webp\" title=\"REGEXEXTRACT \u7684\u8f38\u5165\" width=\"919\"\/><\/figure>\n<ul>\n<li>\u8f38\u5165\u6b64\u516c\u5f0f\u5f8c\uff0c\u5982\u679c\u5f15\u7528\u7684\u5132\u5b58\u683c\u6709\u96fb\u8a71\u865f\u78bc\uff0c\u5b83\u5c07\u986f\u793a\u70ba\u8f38\u51fa\u3002\u5411\u4e0b\u62d6\u66f3\u516c\u5f0f\u4ee5\u5c07\u6b64\u63d0\u53d6\u5957\u7528\u81f3\u5176\u4ed6\u5132\u5b58\u683c\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u96fb\u8a71\u865f\u78bc\u7684 REGEXEXTRACT \u8f38\u51fa\" class=\"wp-image\" decoding=\"async\" height=\"445\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-447-1.webp\" title=\"\u96fb\u8a71\u865f\u78bc\u7684 REGEXEXTRACT \u8f38\u51fa\" width=\"791\"\/><\/figure>\n<ul>\n<li>\u5c0d\u65bc\u5176\u4ed6\u7b26\u5408\u9805\uff0c\u8acb\u4fee\u6539\u70ba\uff1a<code>=REGEXEXTRACT(A4, \"(\\\\d{3})?[-.\\s]?\\\\d{3}[-.\\s]?\\\\d{4}\", 1)<\/code>\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u4f7f\u7528 REGEXEXTRACT \u9032\u884c\u591a\u500b\u5339\u914d\" class=\"wp-image\" decoding=\"async\" height=\"483\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-448-2.webp\" title=\"\u4f7f\u7528 REGEXEXTRACT \u9032\u884c\u591a\u500b\u5339\u914d\" width=\"858\"\/><\/figure>\n<h2 id=\"using-the-regexreplace-function\">\u4f7f\u7528 REGEXREPLACE \u8b8a\u66f4\u8cc7\u6599\u6a21\u5f0f<\/h2>\n<p>REGEXREPLACE \u51fd\u6578\u53ef\u8b93\u60a8\u5c0b\u627e\u8cc7\u6599\u4e2d\u7684\u7279\u5b9a\u6a21\u5f0f\u4e26\u5c07\u5176\u66ff\u63db\u70ba\u66ff\u4ee3\u683c\u5f0f\u3002\u8a9e\u6cd5\u662f<code>REGEXREPLACE(value, pattern, replacement, [occurrence], [case_sensitive])<\/code>.\u9019<code>value<\/code>\u662f\u60a8\u60f3\u8981\u66ff\u63db\u7684\u5167\u5bb9\uff0c<code>pattern<\/code>\u662f\u60a8\u60f3\u8981\u5c0b\u627e\u7684\u5167\u5bb9\uff0c\u4e26<code>replacement<\/code>\u5b9a\u7fa9\u4e86\u60a8\u8981\u53d6\u4ee3\u7684\u5167\u5bb9\u3002<\/p>\n<ul>\n<li>\u5229\u7528\u5148\u524d\u7684\u6578\u64da\uff0c\u61c9\u7528\u4ee5\u4e0b\u529f\u80fd\uff1a<code>=REGEXREPLACE(A4, \"(\\\\d{3})?[-.\\s]?\\\\d{3}[-.\\s]?\\\\d{4}\", \"$1-$2-$3\")<\/code>\u5728 Cell C4 \u4e2d\u6a19\u6e96\u5316\u96fb\u8a71\u865f\u78bc\u683c\u5f0f\u3002<\/li>\n<\/ul>\n<figure class=\"wp-block-image\"><img alt=\"\u7528\u65bc\u6a19\u6e96\u5316\u96fb\u8a71\u865f\u78bc\u7684 REGEXREPLACE \u7bc4\u4f8b\" class=\"wp-image\" decoding=\"async\" height=\"493\" loading=\"lazy\" src=\"https:\/\/cdn.howtogeek.blog\/wp-content\/uploads\/2025\/01\/image-449-1.webp\" title=\"\u7528\u65bc\u6a19\u6e96\u5316\u96fb\u8a71\u865f\u78bc\u7684 REGEXREPLACE \u7bc4\u4f8b\" width=\"876\"\/><\/figure>\n<h3 id=\"practical-tips-for-regex\">\u4f7f\u7528 REGEX \u51fd\u6578\u7684\u57fa\u672c\u6280\u5de7<\/h3>\n<ul>\n<li>\u719f\u6089\u300c{}\u300d\u548c\u300c[]\u300d\u7b49\u6a19\u8a18\uff0c\u9019\u5c0d\u65bc\u5efa\u7acb\u6709\u6548\u7684 REGEX \u6a21\u5f0f\u81f3\u95dc\u91cd\u8981\u3002<\/li>\n<li>\u78ba\u4fdd\u60a8\u7684\u8cc7\u6599\u7d50\u69cb\u826f\u597d\uff0c\u4ee5\u9632\u6b62\u4f7f\u7528 REGEX \u51fd\u6578\u6642\u51fa\u73fe\u4f75\u767c\u75c7\u3002<\/li>\n<li>\u8003\u616e\u5229\u7528\u689d\u4ef6\u683c\u5f0f\u548c REGEX \u4f86\u589e\u5f37\u8cc7\u6599\u8996\u89ba\u5316\u548c\u5206\u6790\u3002<\/li>\n<li>Excel \u63d0\u4f9b\u5176\u4ed6\u8cc7\u6599\u64f7\u53d6\u6280\u8853\uff0c\u4f8b\u5982 Flash Fill \u548c TEXTSPLIT\uff0c\u4ee5\u9032\u4e00\u6b65\u8c50\u5bcc\u60a8\u7684\u8cc7\u6599\u64cd\u4f5c\u5de5\u5177\u5305\u3002<\/li>\n<\/ul>\n<p><a href=\"https:\/\/support.microsoft.com\/en-us\/office\/excel-help-55 Cbd404-814f-5300-8357-7697ff98bca4\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">\u5c0d\u65bc\u90a3\u4e9b\u5e0c\u671b\u52a0\u6df1\u5c0d Excel \u4e2d REGEX \u529f\u80fd\u7684\u7406\u89e3\u7684\u4eba\uff0c\u8acb\u53c3\u95b1Microsoft Excel \u8aaa\u660e\u9801\u9762<\/a>\u4e0a\u7684\u5b98\u65b9\u6587\u4ef6\u6216\u700f\u89bd<a href=\"https:\/\/www.regular-expressions.info\/\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">\u6b64\u7d9c\u5408 REGEX \u6307\u5357<\/a>\u3002<\/p>\n<h2>\u5e38\u898b\u554f\u984c\u89e3\u7b54<\/h2>\n<h3><strong>1. Excel\u4e2d\u7684REGEX\u51fd\u6578\u6709\u4ec0\u9ebc\u7528\uff1f<\/strong><\/h3>\n<p>Excel \u4e2d\u7684 REGEX \u51fd\u6578\u53ef\u8b93\u4f7f\u7528\u8005\u6709\u6548\u7387\u5730\u5c0b\u627e\u7279\u5b9a\u6a21\u5f0f\u3001\u64f7\u53d6\u8cc7\u8a0a\u6216\u53d6\u4ee3\u5132\u5b58\u683c\u5167\u7684\u6587\u5b57\u3002\u5b83\u5011\u5c0d\u65bc\u8cc7\u6599\u9a57\u8b49\u6216\u8f49\u63db\u8cc7\u6599\u96c6\u4ee5\u6eff\u8db3\u7279\u5b9a\u7684\u683c\u5f0f\u6a19\u6e96\u975e\u5e38\u6709\u50f9\u503c\u3002<\/p>\n<h3><strong>2. \u5982\u4f55\u78ba\u4fdd\u6211\u7684 REGEX \u6a21\u5f0f\u6b63\u78ba\uff1f<\/strong><\/h3>\n<p>\u5728\u55ae\u7368\u7684 REGEX \u5de5\u5177\u4e2d\u6e2c\u8a66 REGEX \u6a21\u5f0f\u6216\u4f7f\u7528\u7dda\u4e0a REGEX \u6e2c\u8a66\u5668\u53ef\u4ee5\u5e6b\u52a9\u78ba\u4fdd\u5728 Excel \u4e2d\u61c9\u7528\u5b83\u5011\u4e4b\u524d\u7684\u6e96\u78ba\u6027\u3002\u6b64\u5916\uff0c\u5f9e\u7c21\u55ae\u7684\u6a21\u5f0f\u958b\u59cb\uff0c\u9010\u6f38\u5efa\u7acb\u8907\u96dc\u6027\u4ee5\u907f\u514d\u8a9e\u6cd5\u554f\u984c\u3002<\/p>\n<h3><strong>3. \u6211\u53ef\u4ee5\u5c07 REGEX \u7528\u65bc\u96fb\u8a71\u865f\u78bc\u4ee5\u5916\u7684\u4e0d\u540c\u985e\u578b\u7684\u8cc7\u6599\u55ce\uff1f<\/strong><\/h3>\n<p>\u7d55\u5c0d\u5730\uff01 REGEX \u7528\u9014\u5ee3\u6cdb\uff0c\u53ef\u7528\u65bc\u8b58\u5225\u3001\u63d0\u53d6\u6216\u66ff\u63db\u5404\u7a2e\u8cc7\u6599\u985e\u578b\uff0c\u5305\u62ec\u96fb\u5b50\u90f5\u4ef6\u5730\u5740\u3001URL\u3001\u7522\u54c1\u4ee3\u78bc\u4ee5\u53ca\u9075\u5faa\u53ef\u8b58\u5225\u6a21\u5f0f\u7684\u4efb\u4f55\u6587\u5b57\u5b57\u4e32\u3002<\/p>\n<p><a class=\"xiaomi\" href=\"https:\/\/allthings.how\/how-to-use-the-regex-functions-in-excel\/\" rel=\"noopener noreferrer nofollow\" target=\"_blank\">\u4f86\u6e90\u548c\u5716\u7247<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2024 \u5e74\uff0c\u5fae\u8edf\u900f\u904e\u5f15\u5165\u4ee5\u6b63\u898f\u8868\u793a\u5f0f (REGEX) \u70ba\u4e2d\u5fc3\u7684\u4e09\u500b\u5f37\u5927\u529f\u80fd\u4f86\u63d0\u5347 Excel \u7684\u529f\u80fd\u3002\u9019\u4e9b\u51fd\u6578\uff08\u5373 REGEXTEST\u3001REGEXEXTRACT \u548c REGEXREPLACE\uff09\u4f7f\u7528\u6236\u80fd\u5920\u6709\u6548\u5730\u8b58\u5225\u3001\u63d0\u53d6\u548c\u66ff\u63db\u8907\u96dc\u7684\u8cc7\u6599\u6a21\u5f0f\u3002\u5b83\u5011\u53ef\u4ee5\u5728 Excel Web \u7248\u672c\u548c Microsoft 365 \u4e2d\u8a2a\u554f\uff0c\u5f9e\u800c\u986f\u8457\u589e\u5f37\u4f7f\u7528\u8005\u7684\u8cc7\u6599\u64cd\u4f5c\u3002 \u4e86\u89e3 Excel \u4e2d\u7684 REGEX \u51fd\u6578 \u6b63\u898f\u8868\u793a\u5f0f\u662f\u5f62\u6210\u641c\u5c0b\u6a21\u5f0f\u7684\u5b57\u5143\u5e8f\u5217\uff0c\u6709\u52a9\u65bc\u8a73\u7d30\u7684\u8cc7\u6599\u5206\u6790\u3002\u9019\u4e9b\u51fd\u6578\u6539\u8b8a\u4e86 Excel \u4f7f\u7528\u8005\u8207\u5176\u8cc7\u6599\u96c6\u4e92\u52d5\u7684\u65b9\u5f0f\uff0c\u4f7f\u8cc7\u6599\u9a57\u8b49\u3001\u63d0\u53d6\u548c\u4fee\u6539\u7b49\u4efb\u52d9\u8b8a\u5f97\u66f4\u7c21\u55ae\u3001\u66f4\u76f4\u89c0\u3002 \u5229\u7528 REGEXTEST \u51fd\u6578 REGEXTEST \u51fd\u6578\u53ef\u5075\u6e2c\u4e00\u6bb5\u6587\u5b57\u4e2d\u662f\u5426\u5b58\u5728\u6307\u5b9a\u6a21\u5f0f\uff0c\u4e26\u7522\u751f TRUE \u6216 FALSE \u8f38\u51fa\u3002\u8a72\u51fd\u6578\u7684\u8a9e\u6cd5\u662fREGEXTEST(value, pattern, [case_sensitive]).\u9019\u88e1\uff0cvalue\u662f\u8981\u6e2c\u8a66\u7684\u76ee\u6a19\u6587\u672c\uff0cpattern\u662f\u8981\u5c0b\u627e\u7684 REGEX \u6a21\u5f0f\uff0c\u5340\u5206\u5927\u5c0f\u5beb\u7684\u53c3\u6578\u662f\u53ef\u9078\u7684\u3002 \u4f8b\u5982\uff0c\u8b93\u6211\u5011\u5206\u6790\u5305\u542b\u7522\u54c1\u6216\u5e33\u6236\u4ee3\u78bc\u7684 Excel \u5de5\u4f5c\u8868\u3002 \u82e5\u8981\u9a57\u8b49\u7a0b\u5f0f\u78bc\u662f\u5426\u5305\u542b\u4efb\u4f55\u6578\u5b57\uff0c\u8acb\u6309\u4e00\u4e0b\u5132\u5b58\u683c C4 \u4e26\u8f38\u5165\uff1a=REGEXTEST(A4, &#8220;[0-9]&#8221;)\u3002 \u5982\u679c\u7a0b\u5f0f\u78bc\u4e2d\u5b58\u5728\u4efb\u4f55\u6578\u5b57\uff0c\u8f38\u51fa\u5c07\u986f\u793a\u300cTRUE\u300d\u3002 \u82e5\u8981\u5728\u5176\u4ed6\u55ae\u5143\u683c\u4e2d\u8907\u88fd\u6b64\u64cd\u4f5c\uff0c\u8acb\u6293\u4f4f\u516c\u5f0f\u55ae\u5143\u683c\u4e00\u89d2\u7684\u586b\u5145\u624b\u67c4\u4e26\u5c07\u5176\u5411\u4e0b\u62d6\u66f3\u4ee5\u81ea\u52d5\u586b\u5145\u76f8\u9130\u55ae\u5143\u683c\u3002 \u82e5\u8981\u6aa2\u67e5\u96fb\u8a71\u865f\u78bc\uff0c\u8acb\u4f7f\u7528\uff1a=REGEXTEST(A4, &#8220;\\(?\\d{3}\\)?[-.\\s]?\\d{4}&#8221;)\u3002 \u548c\u4ee5\u524d\u4e00\u6a23\uff0c\u62d6\u66f3\u624b\u67c4\u4ee5\u61c9\u7528\u5230\u5176\u4ed6\u55ae\u5143\u683c\u3002 \u4f7f\u7528 REGEXEXTRACT \u63d0\u53d6\u6587\u672c REGEXEXTRACT \u51fd\u6578\u5c08\u9580\u7528\u65bc\u5f9e\u7d66\u5b9a\u503c\u4e2d\u63d0\u53d6\u7279\u5b9a\u6587\u5b57\u6bb5\u3002\u5b83\u7684\u8a9e\u6cd5\u662fREGEXEXTRACT(value, pattern, [first_match], [&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":[129,285],"class_list":["post-7648","post","type-post","status-publish","format-standard","hentry","category-how-to","tag-microsoft","tag-microsoft-excel"],"acf":[],"_links":{"self":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/7648","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/comments?post=7648"}],"version-history":[{"count":1,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/7648\/revisions"}],"predecessor-version":[{"id":7649,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/posts\/7648\/revisions\/7649"}],"wp:attachment":[{"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/media?parent=7648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/categories?post=7648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/howtogeek.blog\/zh\/wp-json\/wp\/v2\/tags?post=7648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}