{"id":18372,"date":"2026-07-19T03:10:53","date_gmt":"2026-07-18T18:10:53","guid":{"rendered":"https:\/\/genai-ai.co.jp\/ai-kanri\/?p=18372"},"modified":"2026-07-19T03:10:53","modified_gmt":"2026-07-18T18:10:53","slug":"cc-vba-regexp","status":"publish","type":"post","link":"https:\/\/genai-ai.co.jp\/ai-kanri\/blog\/cc-vba-regexp\/","title":{"rendered":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306e\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u6587\u5b57\u5217\u62bd\u51fa\u30fb\u7f6e\u63db\u30fb\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac"},"content":{"rendered":"\n<style>\n.g-flow-row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;align-items:center;}\n.g-flow-item{background:linear-gradient(135deg,#1a1a1a,#2a1015);color:#fff;border-radius:8px;padding:16px 14px;min-width:130px;flex:1;text-align:center;}\n.g-flow-arrow{color:#dc2626;font-size:20px;font-weight:700;}\n.g-card-row{display:flex;gap:12px;flex-wrap:wrap;margin:0 0 32px;}\n.g-card-row>div{flex:1;min-width:220px;}\n@media(max-width:600px){\n  .g-flow-row{flex-direction:column;}\n  .g-flow-arrow{transform:rotate(90deg);}\n  .g-card-row{flex-direction:column;}\n  .g-card-row>div{min-width:100%;}\n}\n<\/style>\n\n\n\n<div style=\"margin:0 0 32px;\">\n  <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/07\/thumb-cc-vba-regexp.jpg\" alt=\"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306e\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u6587\u5b57\u5217\u62bd\u51fa\u30fb\u7f6e\u63db\u30fb\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac\" style=\"width:100%;height:auto;border-radius:12px;display:block;\">\n<\/div>\n\n\n\n<div style=\"background:#f8f9fa;border-radius:12px;padding:24px 28px;margin:0 0 32px;border-left:4px solid #dc2626;\">\n  <p style=\"font-size:15px;font-weight:700;color:#1a1a1a;margin:0 0 16px;\">\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9<\/p>\n  <ol style=\"margin:0;padding-left:20px;font-size:14px;line-height:2.2;list-style:none;\">\n    <li><a href=\"#sec-01\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">01<\/span>\u6b63\u898f\u8868\u73fe\u3068\u306f\u4f55\u304b\u30fbVBA\u3067\u4f7f\u3046\u7406\u7531<\/a><\/li>\n    <li><a href=\"#sec-02\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">02<\/span>RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u3068\u57fa\u672c\u8a2d\u5b9a<\/a><\/li>\n    <li><a href=\"#sec-03\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">03<\/span>\u6b63\u898f\u8868\u73fe\u306e\u4e3b\u8981\u30e1\u30bf\u6587\u5b57\u4e00\u89a7<\/a><\/li>\n    <li><a href=\"#sec-04\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">04<\/span>Test\u30e1\u30bd\u30c3\u30c9\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u78ba\u8a8d\uff08True\/False\u5224\u5b9a\uff09<\/a><\/li>\n    <li><a href=\"#sec-05\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">05<\/span>Execute\u30e1\u30bd\u30c3\u30c9\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u7d50\u679c\u3092\u53d6\u5f97<\/a><\/li>\n    <li><a href=\"#sec-06\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">06<\/span>Replace\u30e1\u30bd\u30c3\u30c9\u3067\u6587\u5b57\u5217\u7f6e\u63db<\/a><\/li>\n    <li><a href=\"#sec-07\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">07<\/span>\u5b9f\u7528\u30d1\u30bf\u30fc\u30f3\u96c6\uff08\u30e1\u30fc\u30eb\u30fb\u96fb\u8a71\u30fb\u90f5\u4fbf\u756a\u53f7\u30fbURL\uff09<\/a><\/li>\n    <li><a href=\"#sec-08\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">08<\/span>Global\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u5168\u30de\u30c3\u30c1\u51e6\u7406<\/a><\/li>\n    <li><a href=\"#sec-09\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">09<\/span>\u696d\u52d9\u3067\u306e\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3\uff08\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u4e0d\u8981\u6587\u5b57\u9664\u53bb\uff09<\/a><\/li>\n    <li><a href=\"#sec-10\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">10<\/span>Claude Code\u3068\u306e\u7d44\u307f\u5408\u308f\u305b<\/a><\/li>\n    <li><a href=\"#faq\" style=\"color:#495057;text-decoration:none;\"><span style=\"color:#dc2626;font-weight:700;margin-right:8px;\">FAQ<\/span>\u3088\u304f\u3042\u308b\u8cea\u554f<\/a><\/li>\n  <\/ol>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u6b63\u3057\u3044\u5f62\u5f0f\u304b\u3069\u3046\u304b\u3092VBA\u3067\u691c\u8a3c\u3057\u305f\u3044\u300d\u300c\u96fb\u8a71\u756a\u53f7\u3084\u90f5\u4fbf\u756a\u53f7\u3092\u30bb\u30eb\u304b\u3089\u4e00\u62ec\u62bd\u51fa\u3057\u305f\u3044\u300d\u300c\u7279\u5b9a\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217\u3092\u5168\u4ef6\u7f6e\u63db\u3057\u305f\u3044\u300d\u2014\u2014\u3053\u3046\u3057\u305f\u8981\u4ef6\u306b\u6700\u3082\u5f37\u529b\u306a\u624b\u6bb5\u304c\u300cVBA\u306e\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09\u300d\u3067\u3059\u3002Excel\u306e\u95a2\u6570\u3060\u3051\u3067\u306f\u624b\u304c\u5c4a\u304b\u306a\u3044\u3001\u8907\u96d1\u306a\u6587\u5b57\u5217\u51e6\u7406\u30921\u672c\u306e\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001VBA\u3067\u306e\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u3092\u5b8c\u5168\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u30fb\u57fa\u672c\u8a2d\u5b9a\uff08Pattern\u30fbIgnoreCase\u30fbGlobal\uff09\u304b\u3089\u3001Test\/Execute\/Replace\u5404\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3001\u30e1\u30bf\u6587\u5b57\u4e00\u89a7\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30fb\u96fb\u8a71\u756a\u53f7\u30fbURL\u306e\u5b9f\u7528\u30d1\u30bf\u30fc\u30f3\u3001\u696d\u52d9\u3067\u306e\u6d3b\u7528\u4f8b\u307e\u3067\u3001\u30b3\u30fc\u30c9\u4f8b\u3092\u8c4a\u5bcc\u306b\u4ea4\u3048\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u5f0a\u793e\u3067VBA\u3092\u4f7f\u3063\u3066\u696d\u52d9\u81ea\u52d5\u5316\u3092\u3059\u308b\u3068\u304d\u3001\u300c\u6587\u5b57\u5217\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u30fb\u6574\u5f62\u300d\u306e\u5834\u9762\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3048\u308b\u304b\u3069\u3046\u304b\u3067\u4f5c\u696d\u52b9\u7387\u304c\u5927\u304d\u304f\u5909\u308f\u308a\u307e\u3059\u3002InStr\u95a2\u6570\u3084Like\u6f14\u7b97\u5b50\u3067\u306f\u624b\u306b\u8ca0\u3048\u306a\u3044\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u3001RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306a\u30891\u884c\u3067\u51e6\u7406\u3067\u304d\u307e\u3059\u3002\u6700\u521d\u306f\u96e3\u3057\u304f\u611f\u3058\u307e\u3059\u304c\u3001\u57fa\u672c\u30d1\u30bf\u30fc\u30f3\u3092\u899a\u3048\u308c\u3070\u696d\u52d9\u30b3\u30fc\u30c9\u306b\u5373\u5fdc\u7528\u3067\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/strong>\uff1aCreateObject(\"VBScript.RegExp\")\u306e\u66f8\u304d\u65b9\u3068\u30d7\u30ed\u30d1\u30c6\u30a3\u8a2d\u5b9a<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u6b63\u898f\u8868\u73fe\u30e1\u30bf\u6587\u5b57<\/strong>\uff1a.\u30fb*\u30fb+\u30fb?\u30fb^\u30fb$\u30fb[]\u30fb{}\u30fb|\u30fb()\u306e\u610f\u5473\u3068\u4f7f\u3044\u65b9<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Test\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1a\u30d1\u30bf\u30fc\u30f3\u306b\u30de\u30c3\u30c1\u3059\u308b\u304bTrue\/False\u3067\u5224\u5b9a\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Execute\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1aMatches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3067FirstIndex\u30fbLength\u30fbValue\u3092\u53d6\u5f97<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Replace\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1a\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u5225\u306e\u6587\u5b57\u5217\u306b\u7f6e\u63db\u3059\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u5b9f\u7528\u30d1\u30bf\u30fc\u30f3\u96c6<\/strong>\uff1a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30fb\u96fb\u8a71\u756a\u53f7\u30fb\u90f5\u4fbf\u756a\u53f7\u30fbURL\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u306b\u5373\u4f7f\u3048\u308b\u30b3\u30fc\u30c9<\/span><\/div>\n\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-01\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">01<\/span>\n  <span class=\"section-label\" style=\"display:block;\">WHAT IS REGEXP<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u6b63\u898f\u8868\u73fe\u3068\u306f\u4f55\u304b\u30fbVBA\u3067\u4f7f\u3046\u7406\u7531<\/span>\n  <span class=\"section-desc\">\u6587\u5b57\u5217\u306e\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u8a18\u53f7\u3067\u8868\u73fe\u3059\u308b\u5f37\u529b\u306a\u4ed5\u7d44\u307f<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b63\u898f\u8868\u73fe\uff08Regular Expression\uff09\u3068\u306f\u3001\u6587\u5b57\u5217\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u8868\u73fe\u3059\u308b\u305f\u3081\u306e\u300c\u8a18\u53f7\u306e\u8a18\u6cd5\u300d\u3067\u3059\u3002\u305f\u3068\u3048\u3070\u300c\u6570\u5b573\u6841-\u6570\u5b574\u6841\u306e\u96fb\u8a71\u756a\u53f7\u300d\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u3092\u3001\u6b63\u898f\u8868\u73fe\u3067\u306f <code>\\d{3}-\\d{4}<\/code> \u3068\u66f8\u3051\u307e\u3059\u3002\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u4f7f\u3063\u3066\u300c\u6587\u5b57\u5217\u304c\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u304b\uff08\u691c\u8a3c\uff09\u300d\u300c\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u90e8\u5206\u3092\u53d6\u308a\u51fa\u3059\uff08\u62bd\u51fa\uff09\u300d\u300c\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u90e8\u5206\u3092\u7f6e\u63db\u3059\u308b\uff08\u7f6e\u63db\uff09\u300d\u3068\u3044\u30463\u3064\u306e\u64cd\u4f5c\u304c\u884c\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306b\u306f\u6a19\u6e96\u3067\u5f37\u529b\u306a\u6587\u5b57\u5217\u95a2\u6570\uff08InStr\u30fbMid\u30fbLeft\u30fbRight\u30fbReplace\u30fbLike\uff09\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u300c\u8907\u6570\u306e\u6761\u4ef6\u3092\u7d44\u307f\u5408\u308f\u305b\u305f\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u300d\u300c\u7e70\u308a\u8fd4\u3057\u306e\u8868\u73fe\u300d\u300c\u4f4d\u7f6e\u6307\u5b9a\uff08\u5148\u982d\u30fb\u672b\u5c3e\uff09\u300d\u306a\u3069\u306f\u3053\u308c\u3089\u306e\u95a2\u6570\u3067\u306f\u8a18\u8ff0\u304c\u56f0\u96e3\u3067\u3059\u3002\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3048\u3070\u3001\u3053\u3046\u3057\u305f\u8907\u96d1\u306a\u6761\u4ef6\u30921\u672c\u306ePattern\u6587\u5b57\u5217\u3067\u8868\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u6b63\u898f\u8868\u73fe\uff08Regular Expression\uff09<\/strong>\uff1a\u6587\u5b57\u5217\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u8a18\u53f7\u3067\u8868\u73fe\u3059\u308b\u305f\u3081\u306e\u8a00\u8a9e\u4ed5\u69d8\u3002\u300c\u3069\u3093\u306a\u6587\u5b57\u304c\u300d\u300c\u4f55\u500b\u300d\u300c\u3069\u306e\u4f4d\u7f6e\u306b\u300d\u6765\u308b\u304b\u3092\u30e1\u30bf\u6587\u5b57\uff08.\u30fb*\u30fb+\u30fb?\u30fb[]\u30fb^\u30fb$\u30fb{}\u30fb|\u30fb()\u7b49\uff09\u3067\u8a18\u8ff0\u3057\u307e\u3059\u3002VBA\u3067\u306fCreateObject(\"VBScript.RegExp\")\u3067RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3001Pattern\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\u3092\u8a2d\u5b9a\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u64cd\u4f5c<\/th><th>VBA\u6a19\u6e96\u95a2\u6570<\/th><th>\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09<\/th><th>\u6b63\u898f\u8868\u73fe\u304c\u512a\u308c\u308b\u5834\u9762<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>\u30d1\u30bf\u30fc\u30f3\u691c\u8a3c<\/td><td>Like\u6f14\u7b97\u5b50\uff08\u9650\u5b9a\u7684\uff09<\/td><td>Test \u2192 True\/False<\/td><td>\u8907\u96d1\u306a\u6761\u4ef6\uff08\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u5f62\u5f0f\u7b49\uff09<\/td><\/tr>\n<tr><td>\u6587\u5b57\u5217\u62bd\u51fa<\/td><td>Mid\/InStr\uff08\u56fa\u5b9a\u4f4d\u7f6e\uff09<\/td><td>Execute \u2192 Matches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3<\/td><td>\u53ef\u5909\u4f4d\u7f6e\u30fb\u8907\u6570\u30de\u30c3\u30c1\u306e\u4e00\u62ec\u53d6\u5f97<\/td><\/tr>\n<tr><td>\u6587\u5b57\u5217\u7f6e\u63db<\/td><td>Replace\uff08\u56fa\u5b9a\u6587\u5b57\u5217\uff09<\/td><td>Replace\uff08\u30d1\u30bf\u30fc\u30f3\u2192\u7f6e\u63db\uff09<\/td><td>\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u5168\u7b87\u6240\u306e\u4e00\u62ec\u7f6e\u63db<\/td><\/tr>\n<tr><td>\u7e70\u308a\u8fd4\u3057\u8868\u73fe<\/td><td>\u4e0d\u53ef\uff08\u30eb\u30fc\u30d7\u3067\u5bfe\u51e6\uff09<\/td><td>{n}\u30fb{n,m}\u30fb+\u30fb*<\/td><td>\u300c2\u301c5\u6841\u306e\u6570\u5b57\u300d\u306a\u3069\u7bc4\u56f2\u6307\u5b9a\u304c\u7c21\u6f54<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u6587\u5b57\u5217\u30c7\u30fc\u30bf<\/strong><br><span style=\"font-size:12px;\">\u30bb\u30eb\u30fb\u5909\u6570\u30fb\u30d5\u30a1\u30a4\u30eb\u5185\u5bb9<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong><br><span style=\"font-size:12px;\">Pattern\u8a2d\u5b9a<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Test \/ Execute<br>\/ Replace<\/strong><br><span style=\"font-size:12px;\">3\u3064\u306e\u30e1\u30bd\u30c3\u30c9<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u7d50\u679c\u53d6\u5f97<\/strong><br><span style=\"font-size:12px;\">True\/False\u30fbMatches\u30fb\u7f6e\u63db\u6587\u5b57\u5217<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u696d\u52d9\u51e6\u7406\u3078<\/strong><br><span style=\"font-size:12px;\">\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u62bd\u51fa\u30fb\u6574\u5f62<\/span><\/div>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">VBA\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u306b\u306f\u300cMicrosoft VBScript Regular Expressions 5.5\u300d\u3068\u3044\u3046\u53c2\u7167\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3059\u308b\u304b\u3001CreateObject\u3067\u52d5\u7684\u306b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u307e\u3059\u3002CreateObject\u3092\u4f7f\u3048\u3070\u53c2\u7167\u8a2d\u5b9a\u306a\u3057\u3067\u52d5\u4f5c\u3059\u308b\u305f\u3081\u3001\u914d\u5e03\u3059\u308b\u30de\u30af\u30ed\u3067\u306f\u53c2\u7167\u8a2d\u5b9a\u4e0d\u8981\u306eCreateObject\u65b9\u5f0f\u304c\u63a8\u5968\u3067\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-02\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">02<\/span>\n  <span class=\"section-label\" style=\"display:block;\">REGEXP OBJECT<\/span>\n  <span class=\"section-title\" style=\"display:block;\">RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u3068\u57fa\u672c\u8a2d\u5b9a<\/span>\n  <span class=\"section-desc\">CreateObject\u30fbPattern\u30fbIgnoreCase\u30fbGlobal\u306e\u8a2d\u5b9a\u65b9\u6cd5<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u3067RegExp\u3092\u4f7f\u3046\u306b\u306f\u3001\u307e\u305a\u300cRegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002CreateObject\u3092\u4f7f\u3046\u65b9\u6cd5\u3068\u3001\u53c2\u7167\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u3066Dim\u5ba3\u8a00\u3059\u308b\u65b9\u6cd5\u306e2\u901a\u308a\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u4ed6\u306ePC\u3067\u52d5\u304f\u30de\u30af\u30ed\u3092\u914d\u5e03\u3059\u308b\u5834\u5408\u306fCreateObject\u65b9\u5f0f\u304c\u5b89\u5168\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\uff1aVBA\u3067\u6b63\u898f\u8868\u73fe\u3092\u6271\u3046\u305f\u3081\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3002CreateObject(\"VBScript.RegExp\")\u3067\u751f\u6210\u3057\u307e\u3059\u3002\u4e3b\u306a\u30d7\u30ed\u30d1\u30c6\u30a3\u306fPattern\uff08\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\uff09\u30fbIgnoreCase\uff08\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u7121\u8996\uff09\u30fbGlobal\uff08\u5168\u30de\u30c3\u30c1\u3092\u53d6\u5f97\uff09\u3002\u4e3b\u306a\u30e1\u30bd\u30c3\u30c9\u306fTest\uff08\u30de\u30c3\u30c1\u5224\u5b9a\uff09\u30fbExecute\uff08\u30de\u30c3\u30c1\u7d50\u679c\u53d6\u5f97\uff09\u30fbReplace\uff08\u7f6e\u63db\uff09\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; ============================================================\n&#x27; RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\uff082\u3064\u306e\u65b9\u6cd5\uff09\n&#x27; ============================================================\n\n&#x27; \u3010\u65b9\u6cd51\u3011CreateObject\uff08\u53c2\u7167\u8a2d\u5b9a\u4e0d\u8981\u30fb\u914d\u5e03\u30de\u30af\u30ed\u306b\u63a8\u5968\uff09\nSub Method1_CreateObject()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; \u30d7\u30ed\u30d1\u30c6\u30a3\u8a2d\u5b9a\n    re.Pattern = &quot;\\d+&quot;         &#x27; 1\u6841\u4ee5\u4e0a\u306e\u6570\u5b57\u306b\u30de\u30c3\u30c1\u3059\u308b\u30d1\u30bf\u30fc\u30f3\n    re.IgnoreCase = True         &#x27; \u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\n    re.Global = True             &#x27; \u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u53d6\u5f97\uff08False=\u6700\u521d\u306e1\u4ef6\u306e\u307f\uff09\n\n    Dim result As Boolean\n    result = re.Test(&quot;Hello 123 World&quot;)  &#x27; \u2192 True\uff08\u6570\u5b57\u304c\u3042\u308b\uff09\n    MsgBox result  &#x27; True\n\n    Set re = Nothing  &#x27; \u660e\u793a\u7684\u306b\u89e3\u653e\nEnd Sub\n\n&#x27; \u3010\u65b9\u6cd52\u3011\u53c2\u7167\u8a2d\u5b9a\u3042\u308a\uff08\u65e9\u671f\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u30fbIntelliSense\u6709\u52b9\uff09\n&#x27; \u30c4\u30fc\u30eb &gt; \u53c2\u7167\u8a2d\u5b9a &gt; Microsoft VBScript Regular Expressions 5.5 \u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\nSub Method2_EarlyBinding()\n    Dim re As New RegExp  &#x27; \u53c2\u7167\u8a2d\u5b9a\u304c\u5fc5\u8981\n\n    re.Pattern = &quot;\\d+&quot;\n    re.IgnoreCase = False\n    re.Global = True\n\n    MsgBox re.Test(&quot;abc 456 def&quot;)  &#x27; True\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u30d7\u30ed\u30d1\u30c6\u30a3<\/th><th>\u578b<\/th><th>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/th><th>\u8aac\u660e<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>Pattern<\/td><td>String<\/td><td>\"\"\uff08\u7a7a\u6587\u5b57\uff09<\/td><td>\u30de\u30c3\u30c1\u30f3\u30b0\u306b\u4f7f\u3046\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217<\/td><\/tr>\n<tr><td>IgnoreCase<\/td><td>Boolean<\/td><td>False<\/td><td>True=\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044 \/ False=\u533a\u5225\u3059\u308b<\/td><\/tr>\n<tr><td>Global<\/td><td>Boolean<\/td><td>False<\/td><td>True=\u5168\u30de\u30c3\u30c1\u3092\u53d6\u5f97 \/ False=\u6700\u521d\u306e\u30de\u30c3\u30c1\u306e\u307f<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>Pattern\u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\uff1aRegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306b\u8a2d\u5b9a\u3059\u308b\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\u3002VBA\u306e\u6587\u5b57\u5217\u5185\u3067\u306f\u5186\u8a18\u53f7\uff08\\\uff09\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u5fc5\u8981\u306a\u305f\u3081\u3001\\d\uff08\u6570\u5b57\uff09\u306f\"\\\\d\"\u3068\u66f8\u304d\u307e\u3059\u3002\u305f\u3060\u3057VBA\u306eString\u3067\u306f\u5358\u306a\u308b\\\u306f\"\\d\"\u306e\u3088\u3046\u306b1\u3064\u306e\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\u3068\u3057\u3066\u6271\u308f\u308c\u307e\u3059\uff08C\u8a00\u8a9e\u7b49\u306e\u4e8c\u91cd\u30a8\u30b9\u30b1\u30fc\u30d7\u306f\u4e0d\u8981\uff09\u3002\u5b9f\u969b\u306e\u30b3\u30fc\u30c9\u3067\\d\u3068\u66f8\u304f\u3068Pattern\u6587\u5b57\u5217\u306f\\d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">VBA\u3067\u306e\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\u306e\u6271\u3044<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">VBA\u306e\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3067\u306f\u3001\\\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\uff09\u306f\u7279\u5225\u306a\u30a8\u30b9\u30b1\u30fc\u30d7\u6587\u5b57\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081 \"\\d\" \u3068\u66f8\u304f\u3068Pattern\u6587\u5b57\u5217\u306f \\d\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5+d\uff09\u306b\u306a\u308a\u3001\u6b63\u898f\u8868\u73fe\u306e\u300c\u6570\u5b57\u300d\u30e1\u30bf\u6587\u5b57\u3068\u3057\u3066\u6b63\u3057\u304f\u6a5f\u80fd\u3057\u307e\u3059\u3002Python\u306e\u3088\u3046\u306b \"\\\\\"\u30682\u91cd\u306b\u66f8\u304f\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30d7\u30ed\u30d1\u30c6\u30a3\u8a2d\u5b9a\u306e\u5b9f\u4f8b\nSub RegExpProperties()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; VBA\u3067\u306f &quot;\\d&quot; \u3067\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\u306f \\d\uff08\u6570\u5b57\u30e1\u30bf\u6587\u5b57\uff09\u306b\u306a\u308b\n    re.Pattern = &quot;\\d{3}-\\d{4}&quot;  &#x27; \u30d1\u30bf\u30fc\u30f3: \u6570\u5b573\u6841-\u6570\u5b574\u6841\uff08\u5e02\u5916\u5c40\u756a\u306a\u3057\u96fb\u8a71\u756a\u53f7\uff09\n    re.IgnoreCase = False           &#x27; \u96fb\u8a71\u756a\u53f7\u306f\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306e\u533a\u5225\u4e0d\u8981\u3060\u304c\u660e\u793a\n    re.Global = True                &#x27; \u8907\u6570\u30de\u30c3\u30c1\u3092\u5168\u3066\u53d6\u5f97\n\n    &#x27; IgnoreCase \u306e\u52b9\u679c\u3092\u78ba\u8a8d\n    re.Pattern = &quot;[a-z]+&quot;   &#x27; \u5c0f\u6587\u5b57\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\n    re.IgnoreCase = False\n    MsgBox re.Test(&quot;HELLO&quot;)  &#x27; False\uff08\u5927\u6587\u5b57\u306f\u4e00\u81f4\u3057\u306a\u3044\uff09\n\n    re.IgnoreCase = True\n    MsgBox re.Test(&quot;HELLO&quot;)  &#x27; True\uff08\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u7121\u8996\u3057\u3066a-z\u306b\u4e00\u81f4\uff09\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f1\u56de\u3060\u3051\u4f5c\u6210\u3057\u3066\u4f7f\u3044\u56de\u305b\u307e\u3059\u3002\u30d7\u30ed\u30b7\u30fc\u30b8\u30e3\u5192\u982d\u3067CreateObject\u3057\u3066\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8a2d\u5b9a\u3057\u3001\u8907\u6570\u56deTest\/Execute\/Replace\u3092\u547c\u3076\u306e\u304c\u52b9\u7387\u7684\u3067\u3059\u3002\u5927\u91cf\u306e\u30bb\u30eb\u3092\u51e6\u7406\u3059\u308b\u30eb\u30fc\u30d7\u306e\u4e2d\u3067CreateObject\u3092\u547c\u3076\u3068\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u843d\u3061\u308b\u305f\u3081\u3001\u30eb\u30fc\u30d7\u306e\u5916\u30671\u56de\u3060\u3051\u751f\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-03\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">03<\/span>\n  <span class=\"section-label\" style=\"display:block;\">METACHARACTERS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u6b63\u898f\u8868\u73fe\u306e\u4e3b\u8981\u30e1\u30bf\u6587\u5b57\u4e00\u89a7<\/span>\n  <span class=\"section-desc\">.\u30fb*\u30fb^\u30fb$\u30fb[]\u30fb+\u30fb?\u30fb{}\u30fb|\u30fb()\u306e\u610f\u5473\u3068\u4f7f\u3044\u65b9<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b63\u898f\u8868\u73fe\u306e\u300c\u30e1\u30bf\u6587\u5b57\u300d\u306f\u3001\u7279\u5225\u306a\u610f\u5473\u3092\u6301\u3064\u8a18\u53f7\u3067\u3059\u3002\u3053\u308c\u3089\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3053\u3068\u3067\u8907\u96d1\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u8868\u73fe\u3067\u304d\u307e\u3059\u3002VBA\uff08VBScript RegExp\uff09\u3067\u4f7f\u3048\u308b\u30e1\u30bf\u6587\u5b57\u3092\u4f53\u7cfb\u7684\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>\u30e1\u30bf\u6587\u5b57<\/strong>\uff1a\u6b63\u898f\u8868\u73fe\u306e\u4e2d\u3067\u7279\u5225\u306a\u610f\u5473\u3092\u6301\u3064\u8a18\u53f7\u306e\u7dcf\u79f0\u3002.\u30fb*\u30fb+\u30fb?\u30fb^\u30fb$\u30fb[]\u30fb{}\u30fb|\u30fb()\u30fb\\\u306a\u3069\u3002\u3053\u308c\u3089\u3092\u305d\u306e\u307e\u307e\u306e\u30ea\u30c6\u30e9\u30eb\u6587\u5b57\u3068\u3057\u3066\u691c\u7d22\u3057\u305f\u3044\u5834\u5408\u306f\u3001\\\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\uff09\u3067\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u307e\u3059\uff08\u4f8b\uff1a\u30d4\u30ea\u30aa\u30c9\u3092\u691c\u7d22 \u2192 \\. \uff09\u3002<\/p>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3-1. \u6587\u5b57\u30af\u30e9\u30b9\u30fb\u30b7\u30e7\u30fc\u30c8\u30cf\u30f3\u30c9<\/h3>\n\n\n\n<table>\n<thead><tr><th>\u30e1\u30bf\u6587\u5b57<\/th><th>\u610f\u5473<\/th><th>VBA\u3067\u306e\u8a18\u8ff0<\/th><th>\u4f8b<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>.\uff08\u30c9\u30c3\u30c8\uff09<\/td><td>\u6539\u884c\u4ee5\u5916\u306e\u4efb\u610f\u306e1\u6587\u5b57<\/td><td>\".\"<\/td><td>\"a.c\" \u2192 abc, aXc, a1c \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>\\d<\/td><td>\u6570\u5b57\uff080\u301c9\uff09<\/td><td>\"\\\\d\"<\/td><td>\"\\\\d+\" \u2192 1, 23, 456 \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>\\D<\/td><td>\u6570\u5b57\u4ee5\u5916<\/td><td>\"\\\\D\"<\/td><td>\"\\\\D+\" \u2192 abc, xyz \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>\\w<\/td><td>\u82f1\u6570\u5b57\u30fb\u30a2\u30f3\u30c0\u30fc\u30b9\u30b3\u30a2<\/td><td>\"\\\\w\"<\/td><td>\"\\\\w+\" \u2192 hello, abc_123 \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>\\W<\/td><td>\\w\u4ee5\u5916\uff08\u8a18\u53f7\u30fb\u7a7a\u767d\u7b49\uff09<\/td><td>\"\\\\W\"<\/td><td>\"\\\\W+\" \u2192 @, !, \u30b9\u30da\u30fc\u30b9 \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>\\s<\/td><td>\u7a7a\u767d\u6587\u5b57\uff08\u30b9\u30da\u30fc\u30b9\u30fb\u30bf\u30d6\u30fb\u6539\u884c\uff09<\/td><td>\"\\\\s\"<\/td><td>\"\\\\s+\" \u2192 \u7a7a\u767d \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>\\S<\/td><td>\u7a7a\u767d\u4ee5\u5916<\/td><td>\"\\\\S\"<\/td><td>\"\\\\S+\" \u2192 \u975e\u7a7a\u767d\u6587\u5b57\u5217\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>[abc]<\/td><td>a\u3001b\u3001c\u306e\u3044\u305a\u308c\u304b1\u6587\u5b57<\/td><td>\"[abc]\"<\/td><td>\"[aeiou]\" \u2192 \u6bcd\u97f3\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>[a-z]<\/td><td>a\u304b\u3089z\u306e\u7bc4\u56f2\u306e1\u6587\u5b57<\/td><td>\"[a-z]\"<\/td><td>\"[a-zA-Z]\" \u2192 \u82f1\u5b57\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>[^abc]<\/td><td>a\u30fbb\u30fbc\u4ee5\u5916\u306e1\u6587\u5b57<\/td><td>\"[^abc]\"<\/td><td>\"[^0-9]\" \u2192 \u6570\u5b57\u4ee5\u5916\u306b\u4e00\u81f4<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<h3 class=\"wp-block-heading\">3-2. \u91cf\u6307\u5b9a\u5b50\uff08\u7e70\u308a\u8fd4\u3057\uff09<\/h3>\n\n\n\n<table>\n<thead><tr><th>\u30e1\u30bf\u6587\u5b57<\/th><th>\u610f\u5473<\/th><th>VBA\u3067\u306e\u8a18\u8ff0<\/th><th>\u4f8b<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>*<\/td><td>0\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057<\/td><td>\"a*\"<\/td><td>\"ab*c\" \u2192 ac, abc, abbc \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>+<\/td><td>1\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057<\/td><td>\"a+\"<\/td><td>\"\\\\d+\" \u2192 1, 12, 123\uff08\u6700\u4f4e1\u6841\uff09\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>?<\/td><td>0\u56de\u307e\u305f\u306f1\u56de<\/td><td>\"a?\"<\/td><td>\"colou?r\" \u2192 color, colour \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>{n}<\/td><td>\u3061\u3087\u3046\u3069n\u56de<\/td><td>\"a{3}\"<\/td><td>\"\\\\d{4}\" \u2192 4\u6841\u306e\u6570\u5b57\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>{n,m}<\/td><td>n\u56de\u4ee5\u4e0am\u56de\u4ee5\u4e0b<\/td><td>\"a{2,4}\"<\/td><td>\"\\\\d{2,4}\" \u2192 2\u301c4\u6841\u306e\u6570\u5b57\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>{n,}<\/td><td>n\u56de\u4ee5\u4e0a<\/td><td>\"a{2,}\"<\/td><td>\"\\\\d{3,}\" \u2192 3\u6841\u4ee5\u4e0a\u306e\u6570\u5b57\u306b\u4e00\u81f4<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<h3 class=\"wp-block-heading\">3-3. \u30a2\u30f3\u30ab\u30fc\u30fb\u30b0\u30eb\u30fc\u30d7\u30fb\u9078\u629e<\/h3>\n\n\n\n<table>\n<thead><tr><th>\u30e1\u30bf\u6587\u5b57<\/th><th>\u610f\u5473<\/th><th>VBA\u3067\u306e\u8a18\u8ff0<\/th><th>\u4f8b<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>^<\/td><td>\u6587\u5b57\u5217\u306e\u5148\u982d<\/td><td>\"^abc\"<\/td><td>\"^\\\\d\" \u2192 \u6570\u5b57\u3067\u59cb\u307e\u308b\u6587\u5b57\u5217\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>$<\/td><td>\u6587\u5b57\u5217\u306e\u672b\u5c3e<\/td><td>\"abc$\"<\/td><td>\"\\\\d$\" \u2192 \u6570\u5b57\u3067\u7d42\u308f\u308b\u6587\u5b57\u5217\u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>|<\/td><td>\u9078\u629e\uff08\u307e\u305f\u306f\uff09<\/td><td>\"a|b\"<\/td><td>\"cat|dog\" \u2192 cat \u307e\u305f\u306f dog \u306b\u4e00\u81f4<\/td><\/tr>\n<tr><td>()<\/td><td>\u30b0\u30eb\u30fc\u30d7\u5316\u30fb\u30ad\u30e3\u30d7\u30c1\u30e3<\/td><td>\"(ab)+\"<\/td><td>\"(\\\\d{3})-(\\\\d{4})\" \u2192 \u96fb\u8a71\u756a\u53f7\u30b0\u30eb\u30fc\u30d7\u5316<\/td><\/tr>\n<tr><td>\\b<\/td><td>\u5358\u8a9e\u5883\u754c<\/td><td>\"\\\\b\"<\/td><td>\"\\\\bword\\\\b\" \u2192 \u5358\u8a9e\u300cword\u300d\u306b\u4e00\u81f4<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30e1\u30bf\u6587\u5b57\u306e\u4f7f\u3044\u65b9\u30b5\u30f3\u30d7\u30eb\nSub MetaCharacterExamples()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; \u30c9\u30c3\u30c8\uff08\u4efb\u610f\u306e1\u6587\u5b57\uff09\n    re.Pattern = &quot;a.c&quot;\n    MsgBox re.Test(&quot;abc&quot;)   &#x27; True\n    MsgBox re.Test(&quot;a1c&quot;)   &#x27; True\n    MsgBox re.Test(&quot;ac&quot;)    &#x27; False\uff08\u30c9\u30c3\u30c8\u306f1\u6587\u5b57\u5fc5\u9808\uff09\n\n    &#x27; \u91cf\u6307\u5b9a\u5b50\n    re.Pattern = &quot;\\d{3}-\\d{4}&quot;  &#x27; \u96fb\u8a71\u756a\u53f7\uff08\u5e02\u5916\u5c40\u756a\u306a\u3057\uff09\n    MsgBox re.Test(&quot;090-1234&quot;)  &#x27; True\n    MsgBox re.Test(&quot;090-12&quot;)    &#x27; False\uff084\u6841\u5fc5\u8981\uff09\n\n    &#x27; \u30a2\u30f3\u30ab\u30fc\n    re.Pattern = &quot;^\\d+&quot;  &#x27; \u5148\u982d\u304c\u6570\u5b57\n    MsgBox re.Test(&quot;123abc&quot;)  &#x27; True\n    MsgBox re.Test(&quot;abc123&quot;)  &#x27; False\uff08\u5148\u982d\u306f\u82f1\u5b57\uff09\n\n    &#x27; \u6587\u5b57\u30af\u30e9\u30b9\n    re.Pattern = &quot;[a-zA-Z0-9]+&quot;  &#x27; \u82f1\u6570\u5b57\u306e\u307f\n    MsgBox re.Test(&quot;hello123&quot;)  &#x27; True\n    MsgBox re.Test(&quot;hello!@#&quot;)  &#x27; True\uff08\u82f1\u6570\u5b57\u304c1\u6587\u5b57\u4ee5\u4e0a\u3042\u308b\uff09\n\n    &#x27; \u9078\u629e\uff08OR\uff09\n    re.Pattern = &quot;^(jpg|jpeg|png|gif)$&quot;\n    re.IgnoreCase = True\n    MsgBox re.Test(&quot;JPG&quot;)   &#x27; True\uff08IgnoreCase=True\u306e\u305f\u3081\uff09\n    MsgBox re.Test(&quot;bmp&quot;)   &#x27; False\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div style=\"background:#fef2f2;border:2px solid #dc2626;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:20px;\">&#9888;&#65039;<\/span>\n    <strong style=\"color:#dc2626;font-size:16px;\">\u30a8\u30b9\u30b1\u30fc\u30d7\u304c\u5fc5\u8981\u306a\u30e1\u30bf\u6587\u5b57<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">\u6b63\u898f\u8868\u73fe\u306e\u4e2d\u3067\u30e1\u30bf\u6587\u5b57\u305d\u306e\u3082\u306e\uff08.\u30fb*\u30fb+\u30fb?\u30fb[\u30fb]\u30fb(\u30fb)\u30fb{\u30fb}\u30fb^\u30fb$\u30fb|\u30fb\\\uff09\u3092\u30ea\u30c6\u30e9\u30eb\u3068\u3057\u3066\u691c\u7d22\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u524d\u306b\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\u3092\u4ed8\u3051\u3066\u30a8\u30b9\u30b1\u30fc\u30d7\u3057\u307e\u3059\u3002\u4f8b\uff1a\u30d4\u30ea\u30aa\u30c9\u3092\u691c\u7d22\u3057\u305f\u3044 \u2192 Pattern = \"\\.\" \/ \u62ec\u5f27(\u3092\u691c\u7d22 \u2192 Pattern = \"\\(\" \/ \u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\u3092\u691c\u7d22 \u2192 Pattern = \"\\\\\"\uff08VBA\u3067\u306f\"\\\\\\\\\"\u3068\u66f8\u304f\uff09\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-04\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">04<\/span>\n  <span class=\"section-label\" style=\"display:block;\">TEST METHOD<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Test\u30e1\u30bd\u30c3\u30c9\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u78ba\u8a8d\uff08True\/False\u5224\u5b9a\uff09<\/span>\n  <span class=\"section-desc\">\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u304b\u3069\u3046\u304b\u3092Boolean\u5024\u3067\u691c\u8a3c\u3059\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RegExp\u306e\u300cTest\u30e1\u30bd\u30c3\u30c9\u300d\u306f\u3001\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u304cPattern\u306b\u8a2d\u5b9a\u3057\u305f\u6b63\u898f\u8868\u73fe\u3068\u4e00\u81f4\u3059\u308b\u304b\u3069\u3046\u304b\u3092True\/False\u3067\u8fd4\u3057\u307e\u3059\u3002\u300c\u5f62\u5f0f\u304c\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u306e\u691c\u8a3c\uff08\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff09\u300d\u306b\u4f7f\u3044\u307e\u3059\u3002Execute\u30e1\u30bd\u30c3\u30c9\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u3067\u9ad8\u901f\u306a\u305f\u3081\u3001\u30de\u30c3\u30c1\u6709\u7121\u306e\u78ba\u8a8d\u3060\u3051\u304c\u76ee\u7684\u306e\u5834\u5408\u306fTest\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>Test\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1aRegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e1\u30bd\u30c3\u30c9\u3002\u5f15\u6570\u306e\u6587\u5b57\u5217\u304cPattern\u306b\u4e00\u81f4\u3059\u308c\u3070True\u3001\u4e00\u81f4\u3057\u306a\u3051\u308c\u3070False\u3092\u8fd4\u3057\u307e\u3059\u3002\u69cb\u6587\uff1are.Test(\u6587\u5b57\u5217)\u3002Global\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u8a2d\u5b9a\u306f\u7d50\u679c\u306b\u5f71\u97ff\u3057\u307e\u305b\u3093\uff08Test\u306f\u4e00\u81f4\u306e\u6709\u7121\u3060\u3051\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\uff09\u3002\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3084\u6761\u4ef6\u5206\u5c90\u306b\u6700\u9069\u3002Execute\u3088\u308a\u8efd\u91cf\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Test\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\nSub TestMethodExamples()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; ===== \u4f8b1: \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u5f62\u5f0f\u78ba\u8a8d =====\n    re.Pattern = &quot;^[\\w.+-]+@[\\w-]+\\.[a-zA-Z]{2,}$&quot;\n    re.IgnoreCase = True\n    MsgBox re.Test(&quot;user@example.com&quot;)    &#x27; True\uff08\u6b63\u3057\u3044\u5f62\u5f0f\uff09\n    MsgBox re.Test(&quot;user@example&quot;)        &#x27; False\uff08\u30c9\u30e1\u30a4\u30f3\u672b\u5c3e\u306a\u3057\uff09\n    MsgBox re.Test(&quot;@example.com&quot;)        &#x27; False\uff08\u30e6\u30fc\u30b6\u30fc\u540d\u306a\u3057\uff09\n    MsgBox re.Test(&quot;user@@example.com&quot;)   &#x27; False\uff08@\u304c2\u3064\uff09\n\n    &#x27; ===== \u4f8b2: \u90f5\u4fbf\u756a\u53f7\u306e\u5f62\u5f0f\u78ba\u8a8d\uff08NNN-NNNN\u5f62\u5f0f\uff09=====\n    re.Pattern = &quot;^\\d{3}-\\d{4}$&quot;\n    re.IgnoreCase = False\n    MsgBox re.Test(&quot;100-0001&quot;)   &#x27; True\n    MsgBox re.Test(&quot;1000001&quot;)    &#x27; False\uff08\u30cf\u30a4\u30d5\u30f3\u306a\u3057\uff09\n    MsgBox re.Test(&quot;100-00010&quot;)  &#x27; False\uff08\u6570\u5b57\u304c\u591a\u3044\uff09\n\n    &#x27; ===== \u4f8b3: \u65e5\u672c\u8a9e\u6587\u5b57\u3092\u542b\u3080\u78ba\u8a8d =====\n    re.Pattern = &quot;[\\u3040-\\u309F]&quot;  &#x27; \u3072\u3089\u304c\u306a\n    MsgBox re.Test(&quot;\u3053\u3093\u306b\u3061\u306f&quot;)   &#x27; True\n    MsgBox re.Test(&quot;Hello&quot;)        &#x27; False\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4-1. Test\u3092\u4f7f\u3063\u305f\u30bb\u30eb\u4e00\u62ec\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u7bc4\u56f2\u306b\u5bfe\u3057\u3066Test\u3067\u4e00\u62ec\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\nSub ValidateCellRange()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; \u96fb\u8a71\u756a\u53f7\u306e\u5f62\u5f0f\u30c1\u30a7\u30c3\u30af\uff08\u5e02\u5916\u5c40\u756a\u8fbc\u307f: 0XX-XXXX-XXXX \u5f62\u5f0f\uff09\n    re.Pattern = &quot;^0\\d{1,4}-\\d{1,4}-\\d{4}$&quot;\n    re.Global = False\n\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim r As Long\n    For r = 2 To lastRow\n        Dim cellVal As String\n        cellVal = Trim(CStr(ws.Cells(r, 1).Value))\n\n        If re.Test(cellVal) Then\n            ws.Cells(r, 2).Value = &quot;OK&quot;\n            ws.Cells(r, 2).Interior.Color = RGB(198, 239, 206)  &#x27; \u8584\u7dd1\n        Else\n            ws.Cells(r, 2).Value = &quot;NG\uff08\u5f62\u5f0f\u4e0d\u6b63\uff09&quot;\n            ws.Cells(r, 2).Interior.Color = RGB(255, 199, 206)  &#x27; \u8584\u8d64\n        End If\n    Next r\n\n    Set re = Nothing\n    MsgBox &quot;\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5b8c\u4e86\uff08&quot; &amp; lastRow - 1 &amp; &quot;\u4ef6\u51e6\u7406\uff09&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">Test\u3067\u78ba\u8a8d\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u306f\u300c^\uff08\u5148\u982d\uff09\u300d\u3068\u300c$\uff08\u672b\u5c3e\uff09\u300d\u306e\u30a2\u30f3\u30ab\u30fc\u3092\u4ed8\u3051\u308b\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002\"\\d{3}-\\d{4}\"\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u306f\"\u3042\u3044\u3046090-1234\u3048\u304a\"\u3068\u3044\u3046\u6587\u5b57\u5217\u306b\u3082True\u3092\u8fd4\u3057\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u5fc5\u305a\"^\\d{3}-\\d{4}$\"\u3068\u66f8\u3044\u3066\u300c\u6587\u5b57\u5217\u5168\u4f53\u304c\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u300d\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-05\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">05<\/span>\n  <span class=\"section-label\" style=\"display:block;\">EXECUTE METHOD<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Execute\u30e1\u30bd\u30c3\u30c9\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u7d50\u679c\u3092\u53d6\u5f97<\/span>\n  <span class=\"section-desc\">Matches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306eFirstIndex\u30fbLength\u30fbValue\u306e\u4f7f\u3044\u65b9<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RegExp\u306e\u300cExecute\u30e1\u30bd\u30c3\u30c9\u300d\u306f\u3001\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u305f\u90e8\u5206\u306e\u8a73\u7d30\u60c5\u5831\uff08\u30de\u30c3\u30c1\u3057\u305f\u6587\u5b57\u5217\u30fb\u4f4d\u7f6e\u30fb\u9577\u3055\uff09\u3092\u542b\u3080\u300cMatches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u300d\u3092\u8fd4\u3057\u307e\u3059\u3002\u300c\u4f55\u304c\u3069\u3053\u3067\u4e00\u81f4\u3057\u305f\u304b\u300d\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u306b\u4f7f\u3044\u307e\u3059\u3002Global=True\u306b\u3059\u308c\u3070\u3001\u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u4e00\u62ec\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>Matches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u30fbMatch\u30aa\u30d6\u30b8\u30a7\u30af\u30c8<\/strong>\uff1aExecute\u30e1\u30bd\u30c3\u30c9\u306e\u623b\u308a\u5024\u3002\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u5404\u8981\u7d20\uff08Match\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u306f\u4ee5\u4e0b\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u6301\u3061\u307e\u3059\u3002Value\uff1a\u30de\u30c3\u30c1\u3057\u305f\u6587\u5b57\u5217 \/ FirstIndex\uff1a\u30de\u30c3\u30c1\u958b\u59cb\u4f4d\u7f6e\uff080\u59cb\u307e\u308a\uff09 \/ Length\uff1a\u30de\u30c3\u30c1\u3057\u305f\u6587\u5b57\u5217\u306e\u9577\u3055\u3002Matches.Count \u3067\u30de\u30c3\u30c1\u4ef6\u6570\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u30d7\u30ed\u30d1\u30c6\u30a3<\/th><th>\u578b<\/th><th>\u8aac\u660e<\/th><th>\u4f8b\uff08\"hello 123 world 456\"\u3067Pattern=\"\\d+\"\uff09<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>Value<\/td><td>String<\/td><td>\u30de\u30c3\u30c1\u3057\u305f\u6587\u5b57\u5217<\/td><td>\"123\"\uff081\u4ef6\u76ee\uff09\u3001\"456\"\uff082\u4ef6\u76ee\uff09<\/td><\/tr>\n<tr><td>FirstIndex<\/td><td>Long<\/td><td>\u30de\u30c3\u30c1\u958b\u59cb\u4f4d\u7f6e\uff080\u59cb\u307e\u308a\uff09<\/td><td>6\uff081\u4ef6\u76ee\uff09\u300114\uff082\u4ef6\u76ee\uff09<\/td><\/tr>\n<tr><td>Length<\/td><td>Long<\/td><td>\u30de\u30c3\u30c1\u3057\u305f\u6587\u5b57\u5217\u306e\u9577\u3055<\/td><td>3\uff08\"123\"\u306e\u9577\u3055\uff09<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Execute\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\nSub ExecuteMethodExamples()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; ===== \u4f8b1: \u6587\u5b57\u5217\u4e2d\u306e\u5168\u6570\u5b57\u3092\u53d6\u5f97 =====\n    re.Pattern = &quot;\\d+&quot;\n    re.Global = True  &#x27; \u5168\u30de\u30c3\u30c1\u3092\u53d6\u5f97\n\n    Dim matches As Object\n    Set matches = re.Execute(&quot;\u8cfc\u5165\u6570: 123, \u8fd4\u54c1: 45, \u5728\u5eab: 6789&quot;)\n\n    MsgBox &quot;\u30de\u30c3\u30c1\u4ef6\u6570: &quot; &amp; matches.Count  &#x27; 3\n\n    Dim i As Integer\n    For i = 0 To matches.Count - 1\n        Dim m As Object\n        Set m = matches(i)\n        MsgBox &quot;Value=&quot; &amp; m.Value &amp; _\n               &quot; FirstIndex=&quot; &amp; m.FirstIndex &amp; _\n               &quot; Length=&quot; &amp; m.Length\n        &#x27; \u2192 Value=123 FirstIndex=5 Length=3\n        &#x27; \u2192 Value=45 FirstIndex=12 Length=2\n        &#x27; \u2192 Value=6789 FirstIndex=18 Length=4\n    Next i\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">5-1. Execute\u3067\u30bb\u30eb\u304b\u3089\u5024\u3092\u62bd\u51fa\u3057\u3066\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30b7\u30fc\u30c8\u306e\u30bb\u30eb\u304b\u3089\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u5024\u3092\u62bd\u51fa\u3057\u3066\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\nSub ExtractMatchesToList()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; \u96fb\u8a71\u756a\u53f7\u306e\u30d1\u30bf\u30fc\u30f3\uff08\u8907\u6570\u5f62\u5f0f\u5bfe\u5fdc\uff09\n    re.Pattern = &quot;0\\d{1,4}-\\d{1,4}-\\d{4}&quot;\n    re.Global = True\n\n    Dim wsSource As Worksheet\n    Dim wsResult As Worksheet\n    Set wsSource = ActiveSheet\n\n    &#x27; \u7d50\u679c\u51fa\u529b\u30b7\u30fc\u30c8\u306e\u6e96\u5099\n    On Error Resume Next\n    Set wsResult = ThisWorkbook.Sheets(&quot;\u62bd\u51fa\u7d50\u679c&quot;)\n    On Error GoTo 0\n    If wsResult Is Nothing Then\n        Set wsResult = ThisWorkbook.Sheets.Add(After:=wsSource)\n        wsResult.Name = &quot;\u62bd\u51fa\u7d50\u679c&quot;\n    End If\n    wsResult.Cells.Clear\n    wsResult.Cells(1, 1).Value = &quot;\u5143\u30bb\u30eb&quot;\n    wsResult.Cells(1, 2).Value = &quot;\u62bd\u51fa\u5024&quot;\n    wsResult.Cells(1, 3).Value = &quot;\u958b\u59cb\u4f4d\u7f6e&quot;\n\n    Dim outputRow As Long\n    outputRow = 2\n\n    Dim lastRow As Long\n    lastRow = wsSource.Cells(wsSource.Rows.Count, 1).End(xlUp).Row\n\n    Dim r As Long\n    For r = 2 To lastRow\n        Dim cellText As String\n        cellText = CStr(wsSource.Cells(r, 1).Value)\n\n        Dim matches As Object\n        Set matches = re.Execute(cellText)\n\n        If matches.Count &gt; 0 Then\n            Dim m As Object\n            For Each m In matches\n                wsResult.Cells(outputRow, 1).Value = &quot;A&quot; &amp; r  &#x27; \u5143\u30bb\u30eb\u53c2\u7167\n                wsResult.Cells(outputRow, 2).Value = m.Value   &#x27; \u62bd\u51fa\u3057\u305f\u96fb\u8a71\u756a\u53f7\n                wsResult.Cells(outputRow, 3).Value = m.FirstIndex  &#x27; \u958b\u59cb\u4f4d\u7f6e\n                outputRow = outputRow + 1\n            Next m\n        End If\n    Next r\n\n    Set re = Nothing\n    MsgBox &quot;\u62bd\u51fa\u5b8c\u4e86: &quot; &amp; outputRow - 2 &amp; &quot;\u4ef6\u3092\u300c\u62bd\u51fa\u7d50\u679c\u300d\u30b7\u30fc\u30c8\u306b\u51fa\u529b\u3057\u307e\u3057\u305f&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">Matches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30d7\u3067\u306f\u300cFor i = 0 To matches.Count - 1\u300d\u3068\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3046\u65b9\u6cd5\u3068\u300cFor Each m In matches\u300d\u306e2\u901a\u308a\u304c\u3042\u308a\u307e\u3059\u3002For Each\u306e\u65b9\u304c\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u304c\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f7f\u3046\u65b9\u6cd5\u306fi\u756a\u76ee\u306e\u30de\u30c3\u30c1\u3092\u53c2\u7167\u3059\u308b\u306a\u3069\u7d30\u304b\u3044\u5236\u5fa1\u304c\u3067\u304d\u307e\u3059\u3002\u30b1\u30fc\u30b9\u306b\u5fdc\u3058\u3066\u4f7f\u3044\u5206\u3051\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:#f0fdf4;border:1px solid #22c55e;border-radius:8px;padding:20px 24px;margin:24px 0;\">\n  <div style=\"display:flex;align-items:center;gap:8px;margin-bottom:12px;\">\n    <span style=\"font-size:18px;\">&#128161;<\/span>\n    <strong style=\"color:#16a34a;font-size:15px;\">FirstIndex\u306f0\u59cb\u307e\u308a\uff08Mid\u95a2\u6570\u3068\u7570\u306a\u308b\uff09<\/strong>\n  <\/div>\n  <p style=\"margin:0;font-size:15px;line-height:1.8;color:#333;\">Match\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e FirstIndex \u306f 0 \u304b\u3089\u59cb\u307e\u308a\u307e\u3059\uff080\u59cb\u307e\u308a\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff09\u3002\u4e00\u65b9\u3001VBA\u306eMid\u95a2\u6570\u306e\u958b\u59cb\u4f4d\u7f6e\u306f1\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\u3002FirstIndex\u3092\u4f7f\u3063\u3066Mid\u3067\u6587\u5b57\u3092\u53d6\u308a\u51fa\u3059\u5834\u5408\u306f\u3001Mid(str, m.FirstIndex + 1, m.Length) \u306e\u3088\u3046\u306b+1\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-06\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">06<\/span>\n  <span class=\"section-label\" style=\"display:block;\">REPLACE METHOD<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Replace\u30e1\u30bd\u30c3\u30c9\u3067\u6587\u5b57\u5217\u7f6e\u63db<\/span>\n  <span class=\"section-desc\">\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u307e\u3068\u3081\u3066\u5225\u306e\u6587\u5b57\u5217\u306b\u7f6e\u63db\u3059\u308b<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RegExp\u306e\u300cReplace\u30e1\u30bd\u30c3\u30c9\u300d\u306f\u3001\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u6307\u5b9a\u3057\u305f\u6587\u5b57\u5217\u306b\u7f6e\u63db\u3057\u307e\u3059\u3002VBA\u6a19\u6e96\u306eReplace\u95a2\u6570\u306f\u300c\u5b8c\u5168\u4e00\u81f4\u3059\u308b\u56fa\u5b9a\u6587\u5b57\u5217\u300d\u3057\u304b\u7f6e\u63db\u3067\u304d\u307e\u305b\u3093\u304c\u3001RegExp\u306eReplace\u306f\u30d1\u30bf\u30fc\u30f3\u3067\u300c\u3069\u3093\u306a\u6587\u5b57\u5217\u3082\u7f6e\u63db\u300d\u3067\u304d\u307e\u3059\u3002Global=True\u306b\u3059\u308c\u3070\u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u4e00\u62ec\u7f6e\u63db\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Replace\u30e1\u30bd\u30c3\u30c9\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\nSub ReplaceMethodExamples()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; ===== \u4f8b1: \u5168\u3066\u306e\u6570\u5b57\u3092\u300cX\u300d\u306b\u7f6e\u63db =====\n    re.Pattern = &quot;\\d&quot;\n    re.Global = True  &#x27; \u5168\u30de\u30c3\u30c1\u3092\u7f6e\u63db\n\n    Dim result As String\n    result = re.Replace(&quot;\u96fb\u8a71: 03-1234-5678\u3001FAX: 03-8765-4321&quot;, &quot;X&quot;)\n    MsgBox result  &#x27; &quot;\u96fb\u8a71: XX-XXXX-XXXX\u3001FAX: XX-XXXX-XXXX&quot;\n\n    &#x27; ===== \u4f8b2: \u4f59\u5206\u306a\u7a7a\u767d\u30921\u3064\u306b\u5727\u7e2e =====\n    re.Pattern = &quot;\\s+&quot;  &#x27; 1\u3064\u4ee5\u4e0a\u306e\u7a7a\u767d\uff08\u30b9\u30da\u30fc\u30b9\u30fb\u30bf\u30d6\u7b49\uff09\n    result = re.Replace(&quot;Hello   World  \u3053\u3093\u306b\u3061\u306f&quot;, &quot; &quot;)\n    MsgBox result  &#x27; &quot;Hello World \u3053\u3093\u306b\u3061\u306f&quot;\n\n    &#x27; ===== \u4f8b3: HTML\u30bf\u30b0\u3092\u9664\u53bb =====\n    re.Pattern = &quot;&lt;[^&gt;]+&gt;&quot;  &#x27; &lt;...&gt; \u306e\u5f62\u5f0f\n    result = re.Replace(&quot;&lt;b&gt;\u592a\u5b57\u30c6\u30ad\u30b9\u30c8&lt;\/b&gt;\u3068&lt;span style=&#x27;color:red&#x27;&gt;\u8d64\u6587\u5b57&lt;\/span&gt;&quot;, &quot;&quot;)\n    MsgBox result  &#x27; &quot;\u592a\u5b57\u30c6\u30ad\u30b9\u30c8\u3068\u8d64\u6587\u5b57&quot;\n\n    &#x27; ===== \u4f8b4: \u96fb\u8a71\u756a\u53f7\u306e\u30cf\u30a4\u30d5\u30f3\u3092\u9664\u53bb =====\n    re.Pattern = &quot;-&quot;\n    result = re.Replace(&quot;090-1234-5678&quot;, &quot;&quot;)\n    MsgBox result  &#x27; &quot;09012345678&quot;\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">6-1. \u5f8c\u65b9\u53c2\u7167\uff08$1\u30fb$2\uff09\u3092\u4f7f\u3063\u305f\u9ad8\u5ea6\u306a\u7f6e\u63db<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Replace\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3001\u30d1\u30bf\u30fc\u30f3\u5185\u306e\u30b0\u30eb\u30fc\u30d7\uff08(...)\u3067\u56f2\u3093\u3060\u90e8\u5206\uff09\u3092\u7f6e\u63db\u5f8c\u306e\u6587\u5b57\u5217\u306b\u300c$1\u300d\u300c$2\u300d\u3068\u3044\u3046\u5f8c\u65b9\u53c2\u7167\u3067\u5f15\u7528\u3067\u304d\u307e\u3059\u3002\u3053\u308c\u3092\u4f7f\u3046\u3068\u300c\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u4e00\u90e8\u3092\u4fdd\u6301\u3057\u306a\u304c\u3089\u7f6e\u63db\u300d\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>IgnoreCase\u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\uff1aRegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3002True\u306b\u3059\u308b\u3068\u6b63\u898f\u8868\u73fe\u30de\u30c3\u30c1\u30f3\u30b0\u3067\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u307e\u305b\u3093\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306fFalse\uff08\u533a\u5225\u3059\u308b\uff09\u3002\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u691c\u8a3c\u3084URL\u30de\u30c3\u30c1\u30f3\u30b0\u306a\u3069\u300c\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3069\u3061\u3089\u3067\u3082\u540c\u3058\u610f\u5473\u3092\u6301\u3064\u300d\u5834\u9762\u3067True\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\u4e00\u65b9\u3001\u30b3\u30fc\u30c9\u3084\u8b58\u5225\u5b50\u306e\u691c\u8a3c\u306a\u3069\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u304c\u610f\u5473\u3092\u6301\u3064\u5834\u9762\u3067\u306fFalse\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09\u306e\u307e\u307e\u306b\u3057\u307e\u3059\u3002<\/p>\n<\/div>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u5f8c\u65b9\u53c2\u7167\uff08$1\u30fb$2\uff09\u3092\u4f7f\u3063\u305f\u7f6e\u63db\nSub ReplaceWithBackreference()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.Global = True\n\n    &#x27; ===== \u4f8b1: \u65e5\u4ed8\u5f62\u5f0f\u3092\u5909\u63db\uff08YYYY\/MM\/DD \u2192 YYYY-MM-DD\uff09=====\n    re.Pattern = &quot;(\\d{4})\/(\\d{2})\/(\\d{2})&quot;\n    &#x27; $1=\u5e74, $2=\u6708, $3=\u65e5\n    Dim result As String\n    result = re.Replace(&quot;2026\/07\/19\u306e\u4f1a\u8b70\u30682026\/08\/01\u306e\u7de0\u5207&quot;, &quot;$1-$2-$3&quot;)\n    MsgBox result  &#x27; &quot;2026-07-19\u306e\u4f1a\u8b70\u30682026-08-01\u306e\u7de0\u5207&quot;\n\n    &#x27; ===== \u4f8b2: \u96fb\u8a71\u756a\u53f7\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u7d71\u4e00\uff08\u30cf\u30a4\u30d5\u30f3\u5f62\u5f0f\u306b\u7d71\u4e00\uff09=====\n    &#x27; 0X0XXXXXXXX\uff08\u30cf\u30a4\u30d5\u30f3\u306a\u3057\uff09\u2192 0X0-XXXX-XXXX\n    re.Pattern = &quot;(0\\d{2})(\\d{4})(\\d{4})&quot;\n    result = re.Replace(&quot;\u9023\u7d61\u5148: 09012345678 \/ 08087654321&quot;, &quot;$1-$2-$3&quot;)\n    MsgBox result  &#x27; &quot;\u9023\u7d61\u5148: 090-1234-5678 \/ 080-8765-4321&quot;\n\n    &#x27; ===== \u4f8b3: \u540d\u524d\u306e\u524d\u5f8c\u306e\u7a7a\u767d\u30c8\u30ea\u30e0 =====\n    re.Pattern = &quot;^\\s+|\\s+$&quot;  &#x27; \u5148\u982d\u307e\u305f\u306f\u672b\u5c3e\u306e\u7a7a\u767d\n    result = re.Replace(&quot;   \u5c71\u7530\u592a\u90ce   &quot;, &quot;&quot;)\n    MsgBox result  &#x27; &quot;\u5c71\u7530\u592a\u90ce&quot;\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u5f8c\u65b9\u53c2\u7167\uff08$1, $2...\uff09\u306f\u975e\u5e38\u306b\u5f37\u529b\u3067\u3059\u3002\u300c\u65e5\u4ed8\u5f62\u5f0f\u306e\u5909\u63db\u300d\u300c\u96fb\u8a71\u756a\u53f7\u306e\u533a\u5207\u308a\u65b9\u5909\u66f4\u300d\u300c\u540d\u524d\u306e\u59d3\u30fb\u540d\u306e\u5165\u308c\u66ff\u3048\u300d\u306a\u3069\u3001\u300c\u5143\u306e\u6587\u5b57\u3092\u90e8\u5206\u7684\u306b\u6b8b\u3057\u306a\u304c\u3089\u5f62\u5f0f\u3060\u3051\u5909\u3048\u308b\u300d\u5834\u9762\u3067\u6d3b\u8e8d\u3057\u307e\u3059\u3002\u30b0\u30eb\u30fc\u30d7\u3092\u8907\u6570\u4f5c\u308c\u3070\uff08\u6700\u59279\u500b\uff09\u3001\u8907\u96d1\u306a\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5909\u63db\u30821\u884c\u306eReplace\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-07\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">07<\/span>\n  <span class=\"section-label\" style=\"display:block;\">PRACTICAL PATTERNS<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u5b9f\u7528\u30d1\u30bf\u30fc\u30f3\u96c6\uff08\u30e1\u30fc\u30eb\u30fb\u96fb\u8a71\u30fb\u90f5\u4fbf\u756a\u53f7\u30fbURL\uff09<\/span>\n  <span class=\"section-desc\">\u696d\u52d9\u3067\u3059\u3050\u4f7f\u3048\u308b\u30d1\u30bf\u30fc\u30f3\u3092\u30b3\u30fc\u30c9\u4ed8\u304d\u3067\u5b8c\u5168\u53ce\u9332<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u696d\u52d9\u3067\u3088\u304f\u5fc5\u8981\u306b\u306a\u308b\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30fb\u96fb\u8a71\u756a\u53f7\u30fb\u90f5\u4fbf\u756a\u53f7\u30fbURL\u300d\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u30d1\u30bf\u30fc\u30f3\u3092\u5b8c\u5168\u53ce\u9332\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u305d\u306e\u307e\u307e\u30b3\u30d4\u30fc\u3057\u3066\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">7-1. \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u691c\u8a3c\u30fb\u62bd\u51fa<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u691c\u8a3c\u3068\u62bd\u51fa\nSub EmailPatterns()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.IgnoreCase = True\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f31: \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u691c\u8a3c\uff08\u30b7\u30f3\u30d7\u30eb\u7248\uff09=====\n    &#x27; \u30e6\u30fc\u30b6\u30fc\u540d@\u30c9\u30e1\u30a4\u30f3.TLD \u306e\u5f62\u5f0f\n    re.Pattern = &quot;^[\\w.+-]+@[\\w-]+(\\.[\\w-]+)*\\.[a-z]{2,}$&quot;\n    re.Global = False\n\n    MsgBox re.Test(&quot;user@example.com&quot;)         &#x27; True\n    MsgBox re.Test(&quot;user.name+tag@example.jp&quot;) &#x27; True\n    MsgBox re.Test(&quot;user@sub.example.co.jp&quot;)   &#x27; True\n    MsgBox re.Test(&quot;user@example&quot;)             &#x27; False\uff08TLD\u306a\u3057\uff09\n    MsgBox re.Test(&quot;@example.com&quot;)             &#x27; False\uff08\u30e6\u30fc\u30b6\u30fc\u540d\u306a\u3057\uff09\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f32: \u30c6\u30ad\u30b9\u30c8\u304b\u3089\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5168\u4ef6\u62bd\u51fa =====\n    re.Pattern = &quot;[\\w.+-]+@[\\w-]+(\\.[\\w-]+)*\\.[a-z]{2,}&quot;\n    re.Global = True\n\n    Dim text As String\n    text = &quot;\u62c5\u5f53: yamada@example.com\u3001\u30b5\u30d6: sato@sub.example.co.jp \u307e\u3067\u9023\u7d61&quot;\n\n    Dim matches As Object\n    Set matches = re.Execute(text)\n\n    Dim emails As String\n    emails = &quot;&quot;\n    Dim m As Object\n    For Each m In matches\n        emails = emails &amp; m.Value &amp; vbCrLf\n    Next m\n    MsgBox &quot;\u62bd\u51fa\u3055\u308c\u305f\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9:&quot; &amp; vbCrLf &amp; emails\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7-2. \u96fb\u8a71\u756a\u53f7\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u30fb\u6b63\u898f\u5316<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u96fb\u8a71\u756a\u53f7\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u30fb\u6b63\u898f\u5316\nSub PhonePatterns()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.Global = True\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f31: \u96fb\u8a71\u756a\u53f7\u691c\u8a3c\uff08\u56fa\u5b9a\u30fb\u643a\u5e2f\u30fb\u30d5\u30ea\u30fc\u30c0\u30a4\u30e4\u30eb\uff09=====\n    &#x27; \u56fa\u5b9a\u96fb\u8a71: 0X-XXXX-XXXX \/ 0XX-XXX-XXXX \/ 0XXX-XX-XXXX\n    &#x27; \u643a\u5e2f: 0X0-XXXX-XXXX\n    &#x27; \u30d5\u30ea\u30fc\u30c0\u30a4\u30e4\u30eb: 0120-XXX-XXX \/ 0800-XXX-XXXX\n    re.Pattern = &quot;^(0\\d{1,4}-\\d{1,4}-\\d{4}|0120-\\d{3}-\\d{3}|0800-\\d{3}-\\d{4})$&quot;\n    re.Global = False\n\n    MsgBox re.Test(&quot;03-1234-5678&quot;)     &#x27; True\uff08\u6771\u4eac\u56fa\u5b9a\uff09\n    MsgBox re.Test(&quot;090-1234-5678&quot;)    &#x27; True\uff08\u643a\u5e2f\uff09\n    MsgBox re.Test(&quot;0120-123-456&quot;)     &#x27; True\uff08\u30d5\u30ea\u30fc\u30c0\u30a4\u30e4\u30eb\uff09\n    MsgBox re.Test(&quot;09012345678&quot;)      &#x27; False\uff08\u30cf\u30a4\u30d5\u30f3\u306a\u3057\uff09\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f32: \u30cf\u30a4\u30d5\u30f3\u3042\u308a\u306a\u3057\u4e21\u5bfe\u5fdc\u3067\u62bd\u51fa =====\n    re.Pattern = &quot;0\\d{1,4}-?\\d{1,4}-?\\d{4}&quot;\n    re.Global = True\n\n    Dim text As String\n    text = &quot;\u96fb\u8a71: 0312345678\u3001FAX: 03-8765-4321\u3001\u643a\u5e2f: 09012345678&quot;\n\n    Dim matches As Object\n    Set matches = re.Execute(text)\n    Dim m As Object\n    For Each m In matches\n        MsgBox &quot;\u96fb\u8a71\u756a\u53f7\u767a\u898b: &quot; &amp; m.Value\n    Next m\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f33: \u30cf\u30a4\u30d5\u30f3\u306a\u3057\u3092\u7d71\u4e00\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u5909\u63db =====\n    &#x27; \u643a\u5e2f\u756a\u53f7 3-4-4 \u5f62\u5f0f\u306b\u7d71\u4e00\n    Dim re2 As Object\n    Set re2 = CreateObject(&quot;VBScript.RegExp&quot;)\n    re2.Pattern = &quot;(0[789]0)(\\d{4})(\\d{4})&quot;\n    re2.Global = True\n\n    Dim result As String\n    result = re2.Replace(&quot;\u9023\u7d61\u5148 09012345678 \/ 08087654321&quot;, &quot;$1-$2-$3&quot;)\n    MsgBox result  &#x27; &quot;\u9023\u7d61\u5148 090-1234-5678 \/ 080-8765-4321&quot;\n\n    Set re = Nothing\n    Set re2 = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7-3. \u90f5\u4fbf\u756a\u53f7\u306e\u691c\u8a3c\u30fb\u62bd\u51fa<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u90f5\u4fbf\u756a\u53f7\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u30fb\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u7d71\u4e00\nSub PostalCodePatterns()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f31: \u90f5\u4fbf\u756a\u53f7\u691c\u8a3c\uff08\u3012NNN-NNNN \/ NNN-NNNN \u4e21\u5bfe\u5fdc\uff09=====\n    re.Pattern = &quot;^(\u3012|\\u00a5)?\\d{3}-\\d{4}$&quot;\n    re.Global = False\n\n    MsgBox re.Test(&quot;100-0001&quot;)   &#x27; True\n    MsgBox re.Test(&quot;\u3012100-0001&quot;) &#x27; True\n    MsgBox re.Test(&quot;1000001&quot;)    &#x27; False\uff08\u30cf\u30a4\u30d5\u30f3\u306a\u3057\uff09\n    MsgBox re.Test(&quot;100-001&quot;)    &#x27; False\uff08\u6841\u6570\u4e0d\u8db3\uff09\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f32: \u30c6\u30ad\u30b9\u30c8\u304b\u3089\u90f5\u4fbf\u756a\u53f7\u3092\u62bd\u51fa =====\n    re.Pattern = &quot;(\u3012)?\\d{3}-\\d{4}&quot;\n    re.Global = True\n\n    Dim matches As Object\n    Set matches = re.Execute(&quot;\u3012100-0001 \u5343\u4ee3\u7530\u533a\u3068\u3012530-0001 \u5927\u962a\u5e02\u5317\u533a&quot;)\n\n    Dim m As Object\n    For Each m In matches\n        MsgBox &quot;\u90f5\u4fbf\u756a\u53f7: &quot; &amp; m.Value\n    Next m\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f33: \u30cf\u30a4\u30d5\u30f3\u306a\u30577\u6841\u2192\u30cf\u30a4\u30d5\u30f3\u3042\u308a\u5f62\u5f0f\u306b\u5909\u63db =====\n    Dim re2 As Object\n    Set re2 = CreateObject(&quot;VBScript.RegExp&quot;)\n    re2.Pattern = &quot;(\\d{3})(\\d{4})&quot;\n    re2.Global = True\n    Dim result As String\n    result = re2.Replace(&quot;1000001 5300001&quot;, &quot;$1-$2&quot;)\n    MsgBox result  &#x27; &quot;100-0001 530-0001&quot;\n\n    Set re = Nothing\n    Set re2 = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">7-4. URL\u306e\u691c\u8a3c\u30fb\u62bd\u51fa<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; URL\u306e\u691c\u8a3c\u3068\u62bd\u51fa\nSub UrlPatterns()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.IgnoreCase = True\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f31: URL\u691c\u8a3c\uff08http\/https\uff09 =====\n    re.Pattern = &quot;^https?:\/\/[\\w\\-\\.]+\\.[a-z]{2,}(\/[\\w\\-\\.\/\\?=&amp;%#]*)?$&quot;\n    re.Global = False\n\n    MsgBox re.Test(&quot;https:\/\/www.example.com&quot;)            &#x27; True\n    MsgBox re.Test(&quot;http:\/\/sub.example.co.jp\/path?q=1&quot;) &#x27; True\n    MsgBox re.Test(&quot;ftp:\/\/example.com&quot;)                  &#x27; False\uff08https\u306e\u307f\uff09\n    MsgBox re.Test(&quot;www.example.com&quot;)                    &#x27; False\uff08\u30b9\u30ad\u30fc\u30e0\u306a\u3057\uff09\n\n    &#x27; ===== \u30d1\u30bf\u30fc\u30f32: \u30c6\u30ad\u30b9\u30c8\u4e2d\u306eURL\u3092\u5168\u4ef6\u62bd\u51fa =====\n    re.Pattern = &quot;https?:\/\/[\\w\\-\\.]+\\.[a-z]{2,}(\/[\\w\\-\\.\/\\?=&amp;%#]*)?&quot;\n    re.Global = True\n\n    Dim text As String\n    text = &quot;\u4f1a\u793eHP: https:\/\/genai-ai.co.jp\/ \/ \u30b5\u30fc\u30d3\u30b9: https:\/\/aikanri.genai-ai.co.jp\/&quot;\n\n    Dim matches As Object\n    Set matches = re.Execute(text)\n\n    Dim m As Object\n    For Each m In matches\n        MsgBox &quot;URL: &quot; &amp; m.Value\n    Next m\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u3053\u308c\u3089\u306e\u30d1\u30bf\u30fc\u30f3\u306f\u300c\u5b8c\u74a7\u306a\u691c\u8a3c\u300d\u3067\u306f\u306a\u304f\u300c\u5b9f\u52d9\u3067\u5341\u5206\u306b\u4f7f\u3048\u308b\u691c\u8a3c\u300d\u3067\u3059\u3002RFC\u6e96\u62e0\u306e\u5b8c\u5168\u306a\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30d1\u30bf\u30fc\u30f3\u306f\u975e\u5e38\u306b\u8907\u96d1\u306b\u306a\u308b\u305f\u3081\u3001\u5b9f\u52d9\u3067\u306f\u300c@\u304c1\u3064\u3042\u308b\u300d\u300c\u30c9\u30e1\u30a4\u30f3\u672b\u5c3e\u304c2\u6587\u5b57\u4ee5\u4e0a\u306e\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u300d\u7a0b\u5ea6\u306e\u30b7\u30f3\u30d7\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\u3067\u5341\u5206\u306a\u3053\u3068\u304c\u307b\u3068\u3093\u3069\u3067\u3059\u3002\u7528\u9014\u306b\u5408\u308f\u305b\u3066\u30d1\u30bf\u30fc\u30f3\u306e\u53b3\u5bc6\u3055\u3092\u8abf\u6574\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-08\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">08<\/span>\n  <span class=\"section-label\" style=\"display:block;\">GLOBAL PROPERTY<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Global\u30d7\u30ed\u30d1\u30c6\u30a3\u3068\u5168\u30de\u30c3\u30c1\u51e6\u7406<\/span>\n  <span class=\"section-desc\">Global=True\/False\u306e\u9055\u3044\u3068\u5168\u30de\u30c3\u30c1\u3092\u51e6\u7406\u3059\u308b\u30d1\u30bf\u30fc\u30f3<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RegExp\u306eGlobal\u30d7\u30ed\u30d1\u30c6\u30a3\u306f\u300c\u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u5bfe\u8c61\u306b\u3059\u308b\u304b\u3069\u3046\u304b\u300d\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002Global=True\uff08\u5168\u30de\u30c3\u30c1\uff09\u306b\u3059\u308b\u3068Execute\u306f\u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u8fd4\u3057\u3001Replace\u306f\u5168\u30de\u30c3\u30c1\u3092\u7f6e\u63db\u3057\u307e\u3059\u3002Global=False\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09\u306b\u3059\u308b\u3068\u6700\u521d\u306e\u30de\u30c3\u30c1\u306e\u307f\u304c\u5bfe\u8c61\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#f8f9fa;border-left:4px solid #6b7280;border-radius:0 8px 8px 0;padding:16px 20px;margin:20px 0;\">\n  <p style=\"margin:0 0 4px;font-size:13px;font-weight:700;color:#6b7280;letter-spacing:1px;\">&#128218; \u7528\u8a9e\u89e3\u8aac<\/p>\n  <p style=\"margin:0;font-size:15px;line-height:1.7;\"><strong>Global\u30d7\u30ed\u30d1\u30c6\u30a3\uff08\u5168\u30de\u30c3\u30c1\u691c\u7d22\uff09<\/strong>\uff1aRegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3002True\u306b\u3059\u308b\u3068\u6587\u5b57\u5217\u5168\u4f53\u3092\u691c\u7d22\u3057\u3066\u5168\u3066\u306e\u30de\u30c3\u30c1\u3092\u8fd4\u3057\u307e\u3059\uff08Execute\u306fMatches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306b\u5168\u4ef6\u3001Replace\u306f\u5168\u30de\u30c3\u30c1\u3092\u7f6e\u63db\uff09\u3002False\u306b\u3059\u308b\u3068\u6700\u521d\u306e\u30de\u30c3\u30c1\u306e\u307f\u3092\u5bfe\u8c61\u306b\u3057\u307e\u3059\u3002Test\u30e1\u30bd\u30c3\u30c9\u306f\u3069\u3061\u3089\u3067\u3082\u52d5\u4f5c\u306f\u540c\u3058\uff08\u4e00\u81f4\u306e\u6709\u7121\u3060\u3051\u78ba\u8a8d\uff09\u3002<\/p>\n<\/div>\n\n\n\n<table>\n<thead><tr><th>\u30e1\u30bd\u30c3\u30c9<\/th><th>Global=True<\/th><th>Global=False<\/th><\/tr><\/thead>\n<tbody>\n<tr><td>Test<\/td><td>\u6587\u5b57\u5217\u4e2d\u306b1\u3064\u3067\u3082\u4e00\u81f4\u304c\u3042\u308c\u3070True<\/td><td>\u540c\u5de6\uff08Global\u306f\u5f71\u97ff\u3057\u306a\u3044\uff09<\/td><\/tr>\n<tr><td>Execute<\/td><td>\u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u8fd4\u3059\uff08Matches.Count >= 1\uff09<\/td><td>\u6700\u521d\u306e\u30de\u30c3\u30c1\u306e\u307f\u8fd4\u3059\uff08Matches.Count = 0 or 1\uff09<\/td><\/tr>\n<tr><td>Replace<\/td><td>\u5168\u30de\u30c3\u30c1\u3092\u7f6e\u63db<\/td><td>\u6700\u521d\u306e\u30de\u30c3\u30c1\u306e\u307f\u7f6e\u63db<\/td><\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Global=True \/ False \u306e\u9055\u3044\u3092\u78ba\u8a8d\nSub GlobalPropertyDemonstration()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.Pattern = &quot;\\d+&quot;\n\n    &#x27; === Global=False\uff08\u30c7\u30d5\u30a9\u30eb\u30c8\uff09===\n    re.Global = False\n    Dim matchesFalse As Object\n    Set matchesFalse = re.Execute(&quot;abc 123 def 456 ghi 789&quot;)\n    MsgBox &quot;Global=False: &quot; &amp; matchesFalse.Count &amp; &quot;\u4ef6&quot;  &#x27; 1\u4ef6\uff08&quot;123&quot;\u306e\u307f\uff09\n\n    Dim resultFalse As String\n    resultFalse = re.Replace(&quot;abc 123 def 456 ghi 789&quot;, &quot;NUM&quot;)\n    MsgBox &quot;Global=False Replace: &quot; &amp; resultFalse  &#x27; &quot;abc NUM def 456 ghi 789&quot;\uff08\u6700\u521d\u3060\u3051\uff09\n\n    &#x27; === Global=True ===\n    re.Global = True\n    Dim matchesTrue As Object\n    Set matchesTrue = re.Execute(&quot;abc 123 def 456 ghi 789&quot;)\n    MsgBox &quot;Global=True: &quot; &amp; matchesTrue.Count &amp; &quot;\u4ef6&quot;  &#x27; 3\u4ef6\uff08&quot;123&quot;\u30fb&quot;456&quot;\u30fb&quot;789&quot;\uff09\n\n    Dim resultTrue As String\n    resultTrue = re.Replace(&quot;abc 123 def 456 ghi 789&quot;, &quot;NUM&quot;)\n    MsgBox &quot;Global=True Replace: &quot; &amp; resultTrue  &#x27; &quot;abc NUM def NUM ghi NUM&quot;\uff08\u5168\u3066\uff09\n\n    Set re = Nothing\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">8-1. \u5168\u30de\u30c3\u30c1\u3092\u914d\u5217\u306b\u53ce\u96c6\u3059\u308b\u6c4e\u7528\u95a2\u6570<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u6b63\u898f\u8868\u73fe\u306e\u5168\u30de\u30c3\u30c1\u3092\u914d\u5217\u3067\u8fd4\u3059\u6c4e\u7528\u95a2\u6570\nFunction RegExpExtractAll(text As String, pattern As String, _\n                          Optional ignoreCase As Boolean = False) As Variant\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.Pattern = pattern\n    re.IgnoreCase = ignoreCase\n    re.Global = True\n\n    Dim matches As Object\n    Set matches = re.Execute(text)\n\n    If matches.Count = 0 Then\n        RegExpExtractAll = Array()  &#x27; \u7a7a\u914d\u5217\n        Exit Function\n    End If\n\n    Dim results() As String\n    ReDim results(0 To matches.Count - 1)\n\n    Dim i As Integer\n    For i = 0 To matches.Count - 1\n        results(i) = matches(i).Value\n    Next i\n\n    RegExpExtractAll = results\n    Set re = Nothing\nEnd Function\n\n&#x27; \u4f7f\u3044\u65b9\nSub UseExtractAll()\n    Dim text As String\n    text = &quot;\u4f1a\u54e1\u756a\u53f7: M-00123, M-00456, M-00789 \u306e3\u540d&quot;\n\n    Dim results As Variant\n    results = RegExpExtractAll(text, &quot;M-\\d{5}&quot;)\n\n    If UBound(results) &gt;= 0 Then\n        Dim i As Integer\n        For i = 0 To UBound(results)\n            MsgBox &quot;\u4f1a\u54e1\u756a\u53f7 &quot; &amp; (i + 1) &amp; &quot;: &quot; &amp; results(i)\n        Next i\n    Else\n        MsgBox &quot;\u30de\u30c3\u30c1\u306a\u3057&quot;\n    End If\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u6587\u5b57\u5217\u5165\u529b<\/strong><br><span style=\"font-size:12px;\">\u30bb\u30eb\u30fb\u5909\u6570<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Global=True<br>\u8a2d\u5b9a<\/strong><br><span style=\"font-size:12px;\">\u5168\u30de\u30c3\u30c1\u5bfe\u8c61<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Execute<\/strong><br><span style=\"font-size:12px;\">Matches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u53d6\u5f97<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>For Each\u30eb\u30fc\u30d7<\/strong><br><span style=\"font-size:12px;\">\u5168Match\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u51e6\u7406<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Value\/Index\/Length<br>\u53d6\u5f97\u30fb\u51e6\u7406<\/strong><\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-09\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">09<\/span>\n  <span class=\"section-label\" style=\"display:block;\">BUSINESS USE CASES<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u696d\u52d9\u3067\u306e\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3\uff08\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u4e0d\u8981\u6587\u5b57\u9664\u53bb\uff09<\/span>\n  <span class=\"section-desc\">Excel\u30c7\u30fc\u30bf\u691c\u8a3c\u30fb\u4e00\u62ec\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u30fb\u30c7\u30fc\u30bf\u6b63\u898f\u5316\u306e\u5b9f\u88c5\u4f8b<\/span>\n<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">9-1. \u9867\u5ba2\u30c7\u30fc\u30bf\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u4e00\u62ec\u30c1\u30a7\u30c3\u30af<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9867\u5ba2\u30ea\u30b9\u30c8\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30fb\u96fb\u8a71\u756a\u53f7\u30fb\u90f5\u4fbf\u756a\u53f7\u3092\u4e00\u62ec\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3057\u3001NG\u884c\u306b\u8272\u4ed8\u3051\u3057\u3066\u62c5\u5f53\u8005\u306b\u901a\u77e5\u3059\u308b\u5b9f\u8df5\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u9867\u5ba2\u30c7\u30fc\u30bf\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u4e00\u62ec\u30c1\u30a7\u30c3\u30af\nSub CustomerDataValidation()\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n\n    &#x27; \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u7528RegExp\u3092\u4f5c\u6210\n    Dim reEmail As Object, rePhone As Object, rePostal As Object\n    Set reEmail = CreateObject(&quot;VBScript.RegExp&quot;)\n    Set rePhone = CreateObject(&quot;VBScript.RegExp&quot;)\n    Set rePostal = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    reEmail.Pattern = &quot;^[\\w.+-]+@[\\w-]+(\\.[\\w-]+)*\\.[a-z]{2,}$&quot;\n    reEmail.IgnoreCase = True\n    reEmail.Global = False\n\n    rePhone.Pattern = &quot;^0\\d{1,4}-\\d{1,4}-\\d{4}$&quot;\n    rePhone.Global = False\n\n    rePostal.Pattern = &quot;^\\d{3}-\\d{4}$&quot;\n    rePostal.Global = False\n\n    &#x27; \u30d8\u30c3\u30c0\u30fc\u884c\u306e\u8a2d\u5b9a\uff08A=\u6c0f\u540d B=\u30e1\u30fc\u30eb C=\u96fb\u8a71 D=\u90f5\u4fbf\u756a\u53f7 E=\u30b9\u30c6\u30fc\u30bf\u30b9\uff09\n    ws.Cells(1, 5).Value = &quot;\u691c\u8a3c\u7d50\u679c&quot;\n\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim ngCount As Long\n    ngCount = 0\n\n    Dim r As Long\n    For r = 2 To lastRow\n        Dim errors As String\n        errors = &quot;&quot;\n\n        &#x27; \u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30c1\u30a7\u30c3\u30af\n        Dim emailVal As String\n        emailVal = Trim(CStr(ws.Cells(r, 2).Value))\n        If emailVal &lt;&gt; &quot;&quot; And Not reEmail.Test(emailVal) Then\n            errors = errors &amp; &quot;\u30e1\u30fc\u30eb\u5f62\u5f0fNG \/ &quot;\n        End If\n\n        &#x27; \u96fb\u8a71\u756a\u53f7\u30c1\u30a7\u30c3\u30af\n        Dim phoneVal As String\n        phoneVal = Trim(CStr(ws.Cells(r, 3).Value))\n        If phoneVal &lt;&gt; &quot;&quot; And Not rePhone.Test(phoneVal) Then\n            errors = errors &amp; &quot;\u96fb\u8a71\u5f62\u5f0fNG \/ &quot;\n        End If\n\n        &#x27; \u90f5\u4fbf\u756a\u53f7\u30c1\u30a7\u30c3\u30af\n        Dim postalVal As String\n        postalVal = Trim(CStr(ws.Cells(r, 4).Value))\n        If postalVal &lt;&gt; &quot;&quot; And Not rePostal.Test(postalVal) Then\n            errors = errors &amp; &quot;\u90f5\u4fbf\u756a\u53f7NG \/ &quot;\n        End If\n\n        If errors &lt;&gt; &quot;&quot; Then\n            ws.Cells(r, 5).Value = Left(errors, Len(errors) - 3)  &#x27; \u672b\u5c3e\u306e &quot; \/ &quot; \u3092\u9664\u53bb\n            ws.Rows(r).Interior.Color = RGB(255, 235, 156)  &#x27; \u8584\u9ec4\u8272\u3067\u30cf\u30a4\u30e9\u30a4\u30c8\n            ngCount = ngCount + 1\n        Else\n            ws.Cells(r, 5).Value = &quot;OK&quot;\n            ws.Cells(r, 5).Interior.Color = RGB(198, 239, 206)  &#x27; \u8584\u7dd1\n        End If\n    Next r\n\n    Set reEmail = Nothing\n    Set rePhone = Nothing\n    Set rePostal = Nothing\n\n    MsgBox &quot;\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u5b8c\u4e86&quot; &amp; vbCrLf &amp; _\n           &quot;\u7dcf\u4ef6\u6570: &quot; &amp; lastRow - 1 &amp; &quot;\u4ef6&quot; &amp; vbCrLf &amp; _\n           &quot;NG\u3042\u308a: &quot; &amp; ngCount &amp; &quot;\u4ef6&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9-2. \u4e0d\u8981\u6587\u5b57\u306e\u4e00\u62ec\u9664\u53bb\u30fb\u30c7\u30fc\u30bf\u30af\u30ec\u30f3\u30b8\u30f3\u30b0<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u30c7\u30fc\u30bf\u30af\u30ec\u30f3\u30b8\u30f3\u30b0: \u4e0d\u8981\u6587\u5b57\u306e\u4e00\u62ec\u9664\u53bb\nSub DataCleansing()\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n\n    Dim reSpaces As Object     &#x27; \u4f59\u5206\u306a\u7a7a\u767d\n    Dim reSymbols As Object    &#x27; \u4e0d\u8981\u306a\u8a18\u53f7\n    Dim reZenNum As Object     &#x27; \u5168\u89d2\u6570\u5b57\u2192\u534a\u89d2\u5909\u63db\uff08\u53c2\u8003\uff09\n\n    Set reSpaces = CreateObject(&quot;VBScript.RegExp&quot;)\n    Set reSymbols = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; \u4f59\u5206\u306a\u7a7a\u767d\uff08\u5148\u982d\u30fb\u672b\u5c3e\u30fb\u9023\u7d9a\u7a7a\u767d\uff09\n    reSpaces.Pattern = &quot;^\\s+|\\s+$|\\s{2,}&quot;\n    reSpaces.Global = True\n\n    &#x27; \u4e0d\u8981\u306a\u8a18\u53f7\uff08\u62ec\u5f27\u30fb\u30b9\u30e9\u30c3\u30b7\u30e5\u30fb\u305d\u306e\u4ed6\uff09\n    reSymbols.Pattern = &quot;[\uff08\uff09()\u3010\u3011\u300c\u300d\u300e\u300f\\[\\]\u300a\u300b\u30fb]&quot;\n    reSymbols.Global = True\n\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim r As Long\n    For r = 2 To lastRow\n        Dim original As String\n        original = CStr(ws.Cells(r, 1).Value)\n\n        &#x27; Step1: \u4f59\u5206\u306a\u7a7a\u767d\u3092\u9664\u53bb\u30fb\u5727\u7e2e\n        Dim cleaned As String\n        cleaned = reSpaces.Replace(original, &quot; &quot;)\n        cleaned = Trim(cleaned)\n\n        &#x27; Step2: \u4e0d\u8981\u8a18\u53f7\u3092\u9664\u53bb\n        &#x27; cleaned = reSymbols.Replace(cleaned, &quot;&quot;)\n\n        ws.Cells(r, 2).Value = cleaned  &#x27; B\u5217\u306b\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u5f8c\u306e\u5024\u3092\u51fa\u529b\n    Next r\n\n    Set reSpaces = Nothing\n    Set reSymbols = Nothing\n    MsgBox &quot;\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u5b8c\u4e86: &quot; &amp; lastRow - 1 &amp; &quot;\u4ef6&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9-3. \u30bb\u30eb\u304b\u3089\u6570\u5024\u3060\u3051\u3092\u62bd\u51fa\u3057\u3066\u5408\u8a08\u3059\u308b<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u300c\u58f2\u4e0a: 123,456\u5186\u300d\u306e\u3088\u3046\u306a\u6587\u5b57\u5217\u304b\u3089\u6570\u5024\u306e\u307f\u62bd\u51fa\u3057\u3066\u5408\u8a08\nSub ExtractNumbersAndSum()\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.Pattern = &quot;[\\d,]+&quot;  &#x27; \u6570\u5b57\u3068\u30ab\u30f3\u30de\n    re.Global = True\n\n    Dim ws As Worksheet\n    Set ws = ActiveSheet\n\n    Dim total As Double\n    total = 0\n\n    Dim lastRow As Long\n    lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row\n\n    Dim r As Long\n    For r = 2 To lastRow\n        Dim cellText As String\n        cellText = CStr(ws.Cells(r, 1).Value)\n\n        Dim matches As Object\n        Set matches = re.Execute(cellText)\n\n        If matches.Count &gt; 0 Then\n            &#x27; \u6700\u521d\u306b\u30de\u30c3\u30c1\u3057\u305f\u6570\u5024\uff08\u30ab\u30f3\u30de\u9664\u53bb\u3057\u3066\u6570\u5024\u5909\u63db\uff09\n            Dim numStr As String\n            numStr = matches(0).Value\n            numStr = Replace(numStr, &quot;,&quot;, &quot;&quot;)  &#x27; \u30ab\u30f3\u30de\u9664\u53bb\n\n            If IsNumeric(numStr) Then\n                Dim num As Double\n                num = CDbl(numStr)\n                ws.Cells(r, 2).Value = num  &#x27; B\u5217\u306b\u6570\u5024\u3092\u51fa\u529b\n                total = total + num\n            End If\n        End If\n    Next r\n\n    ws.Cells(lastRow + 1, 2).Value = total\n    ws.Cells(lastRow + 1, 1).Value = &quot;\u5408\u8a08&quot;\n\n    Set re = Nothing\n    MsgBox &quot;\u6570\u5024\u62bd\u51fa\u5b8c\u4e86\u3002\u5408\u8a08: &quot; &amp; Format(total, &quot;#,##0&quot;) &amp; &quot;\u5186&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u696d\u52d9\u30c7\u30fc\u30bf\u306e\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u3067\u6700\u3082\u4f7f\u3046\u30d1\u30bf\u30fc\u30f3\u306f\u300c\u5148\u982d\u30fb\u672b\u5c3e\u306e\u7a7a\u767d\u9664\u53bb\u300d\u300c\u9023\u7d9a\u7a7a\u767d\u306e\u5727\u7e2e\u300d\u300c\u7279\u5b9a\u8a18\u53f7\u306e\u4e00\u62ec\u9664\u53bb\u300d\u3067\u3059\u3002VBA\u6a19\u6e96\u306eTrim\u95a2\u6570\u306f\u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3092\u9664\u53bb\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u6b63\u898f\u8868\u73fe\u306e\u300c\\s\u300d\u306f\u5168\u89d2\u30b9\u30da\u30fc\u30b9\u3082\u542b\u3080\u7a7a\u767d\u6587\u5b57\u3092\u5bfe\u8c61\u306b\u3067\u304d\u308b\u305f\u3081\u3001\u3088\u308a\u5805\u7262\u306a\u30c8\u30ea\u30e0\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u751f\u30c7\u30fc\u30bf\u5165\u529b<\/strong><br><span style=\"font-size:12px;\">\u7a7a\u767d\u30fb\u8a18\u53f7\u30fb\u6df7\u5728<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>RegExp Pattern\u8a2d\u5b9a<\/strong><br><span style=\"font-size:12px;\">\u9664\u53bb\u5bfe\u8c61\u3092\u5b9a\u7fa9<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Replace\u5b9f\u884c<\/strong><br><span style=\"font-size:12px;\">\u5168\u30de\u30c3\u30c1\u3092\u9664\u53bb\u30fb\u5909\u63db<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u6e08\u307f<\/strong><br><span style=\"font-size:12px;\">\u6574\u5f62\u3055\u308c\u305f\u6587\u5b57\u5217<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>DB\u30fb\u30d5\u30a1\u30a4\u30eb\u3078<\/strong><br><span style=\"font-size:12px;\">\u5f8c\u7d9a\u51e6\u7406\u306b\u6e21\u3059<\/span><\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">9-4. \u4f4f\u6240\u306e\u90fd\u9053\u5e9c\u770c\u62bd\u51fa<\/h3>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; \u4f4f\u6240\u6587\u5b57\u5217\u304b\u3089\u90fd\u9053\u5e9c\u770c\u90e8\u5206\u3092\u62bd\u51fa\u3059\u308b\nFunction ExtractPrefecture(address As String) As String\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n\n    &#x27; \u90fd\u9053\u5e9c\u770c\u30d1\u30bf\u30fc\u30f3\uff08\u6771\u4eac\u90fd\/\u5927\u962a\u5e9c\/\u4eac\u90fd\u5e9c\/\u5317\u6d77\u9053 + \u6b8b\u308a\u306e\u770c\uff09\n    re.Pattern = &quot;^(\u6771\u4eac\u90fd|\u5927\u962a\u5e9c|\u4eac\u90fd\u5e9c|\u5317\u6d77\u9053|\\S+?[\u90fd\u9053\u5e9c\u770c])&quot;\n    re.Global = False\n\n    Dim matches As Object\n    Set matches = re.Execute(address)\n\n    If matches.Count &gt; 0 Then\n        ExtractPrefecture = matches(0).Value\n    Else\n        ExtractPrefecture = &quot;&quot;  &#x27; \u90fd\u9053\u5e9c\u770c\u304c\u5224\u5b9a\u3067\u304d\u306a\u3044\u5834\u5408\n    End If\n\n    Set re = Nothing\nEnd Function\n\n&#x27; \u4f7f\u3044\u65b9\nSub TestExtractPrefecture()\n    MsgBox ExtractPrefecture(&quot;\u6771\u4eac\u90fd\u5343\u4ee3\u7530\u533a\u4e38\u306e\u51851-1-1&quot;)  &#x27; &quot;\u6771\u4eac\u90fd&quot;\n    MsgBox ExtractPrefecture(&quot;\u5927\u962a\u5e9c\u5927\u962a\u5e02\u5317\u533a\u6885\u75301-2-3&quot;)  &#x27; &quot;\u5927\u962a\u5e9c&quot;\n    MsgBox ExtractPrefecture(&quot;\u5317\u6d77\u9053\u672d\u5e4c\u5e02\u4e2d\u592e\u533a1\u6761\u897f1\u4e01\u76ee&quot;)  &#x27; &quot;\u5317\u6d77\u9053&quot;\n    MsgBox ExtractPrefecture(&quot;\u795e\u5948\u5ddd\u770c\u6a2a\u6d5c\u5e02\u897f\u533a\u307f\u306a\u3068\u307f\u3089\u30441-1&quot;)  &#x27; &quot;\u795e\u5948\u5ddd\u770c&quot;\n    MsgBox ExtractPrefecture(&quot;\u57fc\u7389\u770c\u3055\u3044\u305f\u307e\u5e02\u5927\u5bae\u533a123-4&quot;)  &#x27; &quot;\u57fc\u7389\u770c&quot;\nEnd Sub<\/pre>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-10\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">10<\/span>\n  <span class=\"section-label\" style=\"display:block;\">CLAUDE CODE<\/span>\n  <span class=\"section-title\" style=\"display:block;\">Claude Code\u3068VBA\u6b63\u898f\u8868\u73fe\u306e\u7d44\u307f\u5408\u308f\u305b<\/span>\n  <span class=\"section-desc\">\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306e\u751f\u6210\u30fb\u30c7\u30d0\u30c3\u30b0\u30fb\u6539\u5584\u3092AI\u306b\u4efb\u305b\u308b\u65b9\u6cd5<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">VBA\u306e\u6b63\u898f\u8868\u73fe\u3067\u6700\u3082\u96e3\u3057\u3044\u306e\u306f\u300c\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\u306e\u4f5c\u6210\u300d\u3067\u3059\u3002\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u691c\u8a3c\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u3092\u66f8\u3044\u3066\u300d\u3068\u8a00\u308f\u308c\u3066\u3082\u3001\u3069\u3053\u307e\u3067\u53b3\u5bc6\u306b\u3059\u3079\u304d\u304b\u3001\u7279\u6b8a\u30b1\u30fc\u30b9\u3092\u3069\u3046\u6271\u3046\u304b\u306e\u5224\u65ad\u306f\u7d4c\u9a13\u304c\u8981\u308a\u307e\u3059\u3002Claude Code\u3092\u4f7f\u3046\u3068\u3001\u300c\u3007\u3007\u306e\u5f62\u5f0f\u3092\u691c\u8a3c\u3059\u308bVBA\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u3092\u66f8\u3044\u3066\u300d\u3068\u4f9d\u983c\u3059\u308b\u3060\u3051\u3067\u3001\u3059\u3050\u4f7f\u3048\u308b\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\u3068VBA\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30d1\u30bf\u30fc\u30f3\u751f\u6210\u4f9d\u983c<\/strong>\uff1a\u300c\u65e5\u672c\u306e\u643a\u5e2f\u96fb\u8a71\u756a\u53f7\uff08080\/090\/070\u59cb\u307e\u308a\u3001\u30cf\u30a4\u30d5\u30f3\u3042\u308a\/\u306a\u3057\u4e21\u5bfe\u5fdc\uff09\u3092\u691c\u8a3c\u3059\u308bVBA\u6b63\u898f\u8868\u73fe\u3092\u66f8\u3044\u3066\u300d<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30d1\u30bf\u30fc\u30f3\u306e\u8aac\u660e\u4f9d\u983c<\/strong>\uff1a\u300c\"^[\\w.+-]+@[\\w-]+(\\.[\\w-]+)*\\.[a-z]{2,}$\"\u3068\u3044\u3046\u6b63\u898f\u8868\u73fe\u306e\u610f\u5473\u3092\u8aac\u660e\u3057\u3066\u300d<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30a8\u30e9\u30fc\u306e\u30c7\u30d0\u30c3\u30b0<\/strong>\uff1a\u300c\u3053\u306e\u30d1\u30bf\u30fc\u30f3\u3067\"user@sub.example.co.jp\"\u304cFalse\u306b\u306a\u308b\u7406\u7531\u3092\u6559\u3048\u3066\u300d<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u696d\u52d9\u8981\u4ef6\u304b\u3089\u30d1\u30bf\u30fc\u30f3\u5316<\/strong>\uff1a\u300c\u793e\u54e1\u756a\u53f7\u306f\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c82\u6587\u5b57+4\u6841\u306e\u6570\u5b57\u306e\u5f62\u5f0f\u3002VBA\u306eTest\u3067\u691c\u8a3c\u3059\u308b\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u300d<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u65e2\u5b58\u30b3\u30fc\u30c9\u306e\u6539\u5584<\/strong>\uff1a\u300c\u3053\u306eRegExp\u30b3\u30fc\u30c9\u3067InStr+Mid+Replace\u3092\u591a\u7528\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3092\u6b63\u898f\u8868\u73fe\u3067\u66f8\u304d\u76f4\u3057\u3066\u300d<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u6700\u9069\u5316<\/strong>\uff1a\u300c10\u4e07\u884c\u306e\u30eb\u30fc\u30d7\u3067RegExp\u3092\u4f7f\u3063\u3066\u3044\u308b\u304c\u9045\u3044\u3002\u6539\u5584\u65b9\u6cd5\u3092\u63d0\u6848\u3057\u3066\u300d<\/span><\/div>\n\n<\/div>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u5f0a\u793e\u3067\u306f\u300c\u3053\u306e\u696d\u52d9\u30c7\u30fc\u30bf\u306e\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u30d1\u30bf\u30fc\u30f3\u3092\u6b63\u898f\u8868\u73fe\u3067\u66f8\u3044\u3066\u300d\u3068\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u3092\u305d\u306e\u307e\u307eClaude Code\u306b\u8cbc\u308a\u4ed8\u3051\u3066\u4f9d\u983c\u3057\u3066\u3044\u307e\u3059\u3002\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u3092\u898b\u306a\u304c\u3089\u30d1\u30bf\u30fc\u30f3\u3092\u751f\u6210\u3057\u3066\u304f\u308c\u308b\u305f\u3081\u3001\u62bd\u8c61\u7684\u306a\u8aac\u660e\u3060\u3051\u3088\u308a\u7cbe\u5ea6\u306e\u9ad8\u3044\u30d1\u30bf\u30fc\u30f3\u304c\u5f97\u3089\u308c\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:#1e1e1e;border-radius:8px;padding:20px 24px;margin:20px 0;overflow-x:auto;\">\n  <pre style=\"margin:0;font-family:'Courier New',monospace;font-size:13px;line-height:1.8;color:#d4d4d4;white-space:pre-wrap;\">&#x27; Claude Code\u3078\u306e\u4f9d\u983c\u4f8b\u3068\u5178\u578b\u7684\u306a\u56de\u7b54\u30d1\u30bf\u30fc\u30f3\n\n&#x27; ===== \u4f9d\u983c\u4f8b1 =====\n&#x27; \u300c\u793e\u54e1\u756a\u53f7 AB-1234 \u5f62\u5f0f\uff08\u82f1\u5927\u6587\u5b572\u6587\u5b57+\u30cf\u30a4\u30d5\u30f3+4\u6841\u6570\u5b57\uff09\u3092\u691c\u8a3c\u3057\u3066\u300d\n\n&#x27; Claude Code\u304c\u751f\u6210\u3059\u308b\u30b3\u30fc\u30c9\u4f8b:\nFunction IsValidEmployeeId(empId As String) As Boolean\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    re.Pattern = &quot;^[A-Z]{2}-\\d{4}$&quot;  &#x27; \u5927\u6587\u5b572\u6587\u5b57+\u30cf\u30a4\u30d5\u30f3+4\u6841\u6570\u5b57\n    re.IgnoreCase = False              &#x27; \u5927\u6587\u5b57\u306e\u307f\u53d7\u3051\u4ed8\u3051\u308b\n    IsValidEmployeeId = re.Test(empId)\n    Set re = Nothing\nEnd Function\n\n&#x27; \u4f7f\u3044\u65b9\nSub TestEmployeeId()\n    MsgBox IsValidEmployeeId(&quot;AB-1234&quot;)   &#x27; True\n    MsgBox IsValidEmployeeId(&quot;ab-1234&quot;)   &#x27; False\uff08\u5c0f\u6587\u5b57NG\uff09\n    MsgBox IsValidEmployeeId(&quot;ABC-1234&quot;)  &#x27; False\uff083\u6587\u5b57NG\uff09\n    MsgBox IsValidEmployeeId(&quot;AB-123&quot;)    &#x27; False\uff083\u6841NG\uff09\nEnd Sub\n\n&#x27; ===== \u4f9d\u983c\u4f8b2 =====\n&#x27; \u300cIP\u30a2\u30c9\u30ec\u30b9\uff08IPv4\uff09\u306e\u5f62\u5f0f\u3092\u691c\u8a3c\u3059\u308bVBA\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u300d\n\nFunction IsValidIPv4(ip As String) As Boolean\n    Dim re As Object\n    Set re = CreateObject(&quot;VBScript.RegExp&quot;)\n    &#x27; 0-255\u306e\u6570\u5024\u304c4\u7d44\u30c9\u30c3\u30c8\u533a\u5207\u308a\n    re.Pattern = &quot;^((25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$&quot;\n    IsValidIPv4 = re.Test(ip)\n    Set re = Nothing\nEnd Function\n\nSub TestIPv4()\n    MsgBox IsValidIPv4(&quot;192.168.1.1&quot;)    &#x27; True\n    MsgBox IsValidIPv4(&quot;255.255.255.0&quot;)  &#x27; True\n    MsgBox IsValidIPv4(&quot;256.0.0.1&quot;)      &#x27; False\uff08256\u306f\u7121\u52b9\uff09\n    MsgBox IsValidIPv4(&quot;192.168.1&quot;)      &#x27; False\uff084\u30aa\u30af\u30c6\u30c3\u30c8\u5fc5\u8981\uff09\nEnd Sub<\/pre>\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u5f0a\u793e\u306eAI\u9b3c\u7ba1\u7406\u3067\u306f\u3001VBA\u306e\u696d\u52d9\u30de\u30af\u30ed\u4f5c\u6210\u30fb\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u8a2d\u8a08\u30fb\u30b3\u30fc\u30c9\u306e\u30ea\u30d5\u30a1\u30af\u30bf\u30ea\u30f3\u30b0\u3092Claude Code\u3067\u81ea\u52d5\u5316\u3057\u3066\u3044\u307e\u3059\u3002\u300c\u696d\u52d9\u30c7\u30fc\u30bf\u306e\u30b5\u30f3\u30d7\u30eb\u3092\u8cbc\u308a\u4ed8\u3051\u3066\u3001\u3053\u306e\u30c7\u30fc\u30bf\u304b\u3089\u3007\u3007\u3092\u62bd\u51fa\u3059\u308bVBA\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u300d\u3068\u4f9d\u983c\u3059\u308b\u3060\u3051\u3067\u3001\u30c6\u30b9\u30c8\u6e08\u307f\u306e\u30b3\u30fc\u30c9\u304c\u6570\u5206\u3067\u51fa\u6765\u4e0a\u304c\u308a\u307e\u3059\u3002<\/div>\n<\/div>\n\n\n\n<div class=\"g-flow-row\" style=\"margin:24px 0;\">\n  <div class=\"g-flow-item\"><strong>\u696d\u52d9\u8981\u4ef6\u30fb<br>\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf<\/strong><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>Claude Code\u306b<br>\u4f9d\u983c<\/strong><br><span style=\"font-size:12px;\">\u30d1\u30bf\u30fc\u30f3+\u30b3\u30fc\u30c9\u751f\u6210<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>VBA\u30b3\u30fc\u30c9\u306b<br>\u8cbc\u308a\u4ed8\u3051<\/strong><br><span style=\"font-size:12px;\">\u52d5\u4f5c\u78ba\u8a8d<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u30a8\u30c3\u30b8\u30b1\u30fc\u30b9\u78ba\u8a8d<\/strong><br><span style=\"font-size:12px;\">\u8ffd\u52a0\u30c6\u30b9\u30c8\u30fb\u4fee\u6b63\u4f9d\u983c<\/span><\/div>\n  <div class=\"g-flow-arrow\">&#8594;<\/div>\n  <div class=\"g-flow-item\"><strong>\u672c\u756a\u6295\u5165<\/strong><br><span style=\"font-size:12px;\">\u696d\u52d9\u30de\u30af\u30ed\u5b8c\u6210<\/span><\/div>\n<\/div>\n\n\n<div style=\"margin:48px 0 8px;display:flex;gap:12px;justify-content:center;flex-wrap:wrap;\"><a href=\"https:\/\/aikanri.genai-ai.co.jp\/seminar2-blog\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_content=cc-vba-regexp&#038;blog_slug=cc-vba-regexp\" target=\"_blank\" rel=\"noopener\" aria-label=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff08\u7121\u6599\u30fb1on1\u30fb60\u5206\uff09\u306e\u4e88\u7d04\u753b\u9762\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_seminar_claude_code_2026.jpg\" alt=\"Claude Code \u5b8c\u5168\u89e3\u8aac\u30bb\u30df\u30ca\u30fc\uff5c\u7d4c\u55b6\u8005\u30fb\u4f1a\u793e\u5f79\u54e1\u5c02\u7528 1on1 60\u5206 \u7121\u6599\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&#038;utm_medium=h2banner&#038;utm_campaign=cc-vba-regexp&#038;utm_content=h2-banner-kanri\" target=\"_blank\" rel=\"noopener\" aria-label=\"AI\u9b3c\u7ba1\u7406 \u516c\u5f0f\u30b5\u30a4\u30c8\u3078\" style=\"flex:1 1 280px;max-width:360px;text-decoration:none;\"><img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/05\/cta_blog_1to1.jpg\" alt=\"Claude Code\u3092\u7d4c\u55b6\u306b\u6d3b\u304b\u3057\u305f\u3044\u65b9\u3078 \u2014 AI\u9b3c\u7ba1\u7406\" style=\"width:100%;height:auto;border-radius:8px;display:block;\"><\/a><\/div>\n\n\n<div id=\"sec-11\"><\/div>\n<h2 class=\"section-header-img\" style=\"margin:32px 0 24px;border-radius:8px;overflow:hidden;background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);padding:32px 28px;color:#fff;position:relative;border:none;border-left:none;text-align:left;\">\n  <span class=\"section-number\" style=\"display:block;\">11<\/span>\n  <span class=\"section-label\" style=\"display:block;\">CONCLUSION<\/span>\n  <span class=\"section-title\" style=\"display:block;\">\u307e\u3068\u3081<\/span>\n  <span class=\"section-desc\">VBA\u6b63\u898f\u8868\u73fe\u306e\u5168\u4f53\u50cf\u3068\u5b9f\u88c5\u306e\u30dd\u30a4\u30f3\u30c8<\/span>\n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001VBA\u306e\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09\u3092\u5b8c\u5168\u306b\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u30fb\u30d7\u30ed\u30d1\u30c6\u30a3\u8a2d\u5b9a\u304b\u3089\u3001Test\/Execute\/Replace\u5404\u30e1\u30bd\u30c3\u30c9\u306e\u4f7f\u3044\u65b9\u3001\u4e3b\u8981\u30e1\u30bf\u6587\u5b57\u4e00\u89a7\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30fb\u96fb\u8a71\u756a\u53f7\u30fb\u90f5\u4fbf\u756a\u53f7\u30fbURL\u306e\u5b9f\u7528\u30d1\u30bf\u30fc\u30f3\u3001\u696d\u52d9\u3067\u306e\u30c7\u30fc\u30bf\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30fb\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u306e\u5b9f\u8df5\u30b3\u30fc\u30c9\u307e\u3067\u4f53\u7cfb\u7684\u306b\u7db2\u7f85\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div style=\"background:#fafafa;border-radius:8px;padding:16px 20px;margin:16px 0;border-left:4px solid #dc2626;\">\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306fCreateObject\u3067\u4f5c\u6210<\/strong>\uff1a\u53c2\u7167\u8a2d\u5b9a\u4e0d\u8981\u3067\u914d\u5e03\u30de\u30af\u30ed\u306b\u3082\u5b89\u5168<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>3\u3064\u306e\u30d7\u30ed\u30d1\u30c6\u30a3<\/strong>\uff1aPattern\uff08\u30d1\u30bf\u30fc\u30f3\u6587\u5b57\u5217\uff09\u30fbIgnoreCase\uff08\u5927\u6587\u5b57\u5c0f\u6587\u5b57\uff09\u30fbGlobal\uff08\u5168\u30de\u30c3\u30c1\uff09<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Test\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1a\u30d1\u30bf\u30fc\u30f3\u306b\u4e00\u81f4\u3059\u308b\u304bTrue\/False\u3067\u691c\u8a3c\u3002\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306b\u4f7f\u3046<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Execute\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1aMatches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3067\u5168\u30de\u30c3\u30c1\u306eValue\/FirstIndex\/Length\u3092\u53d6\u5f97<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Replace\u30e1\u30bd\u30c3\u30c9<\/strong>\uff1a\u5168\u30de\u30c3\u30c1\u3092\u4e00\u62ec\u7f6e\u63db\u3002\u5f8c\u65b9\u53c2\u7167\uff08$1\u30fb$2\uff09\u3067\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u5909\u63db\u3082\u53ef\u80fd<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>\u5b9f\u7528\u30d1\u30bf\u30fc\u30f3<\/strong>\uff1a\u30e1\u30fc\u30eb\/\u96fb\u8a71\/\u90f5\u4fbf\u756a\u53f7\/URL\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u30d1\u30bf\u30fc\u30f3\u3092\u305d\u306e\u307e\u307e\u6d41\u7528\u3067\u304d\u308b<\/span><\/div>\n<div style=\"display:flex;align-items:flex-start;gap:8px;padding:6px 0;font-size:15px;line-height:1.6;\"><span style=\"color:#dc2626;font-size:16px;flex-shrink:0;margin-top:2px;\">&#10004;&#65039;<\/span><span><strong>Claude Code\u3068\u306e\u7d44\u307f\u5408\u308f\u305b<\/strong>\uff1a\u8981\u4ef6\u3092\u4f1d\u3048\u308b\u3060\u3051\u3067\u30d1\u30bf\u30fc\u30f3\u751f\u6210\u30fb\u30c7\u30d0\u30c3\u30b0\u304c\u81ea\u52d5\u5316\u3067\u304d\u308b<\/span><\/div>\n\n<\/div>\n\n\n\n<div class=\"balloon-wrap\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/ceo-sugasawa.jpg\" alt=\"\u4ee3\u8868\u83c5\u6fa4\">\n    <span class=\"balloon-name\">\u4ee3\u8868\u83c5\u6fa4<\/span>\n  <\/div>\n  <div class=\"balloon-body\">VBA\u306e\u6b63\u898f\u8868\u73fe\u306f\u300c\u6700\u521d\u306f\u3068\u3063\u3064\u304d\u306b\u304f\u3044\u300d\u3067\u3059\u304c\u3001\u3044\u304f\u3064\u304b\u306e\u983b\u51fa\u30d1\u30bf\u30fc\u30f3\uff08\\d\u30fb\\w\u30fb\\s\u30fb[...]\u30fb{n,m}\u30fb^\u30fb$\uff09\u3092\u899a\u3048\u308c\u3070\u3001\u696d\u52d9\u30c7\u30fc\u30bf\u306e\u691c\u8a3c\u30fb\u62bd\u51fa\u30fb\u6574\u5f62\u306e\u5834\u9762\u3067\u5373\u4f7f\u3048\u307e\u3059\u3002\u307e\u305a\u306fTest\u30e1\u30bd\u30c3\u30c9\u306b\u3088\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304b\u3089\u59cb\u3081\u3066\u3001\u6163\u308c\u3066\u304d\u305f\u3089Execute\u3068Replace\u306b\u5fdc\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n\n<h3 class=\"wp-block-heading\">VBA\u6b63\u898f\u8868\u73fe\u306e\u8a2d\u8a08\u304b\u3089\u5b9f\u88c5\u307e\u3067\u3001Claude Code\u3067\u5373\u89e3\u6c7a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u300c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u691c\u8a3c\u3059\u308b\u30d1\u30bf\u30fc\u30f3\u304c\u308f\u304b\u3089\u306a\u3044\u300d\u300c\u696d\u52d9\u30c7\u30fc\u30bf\u306e\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u3092\u81ea\u52d5\u5316\u3057\u305f\u3044\u300d\u300cRegExp\u3092\u4f7f\u3063\u305f\u65e2\u5b58\u30b3\u30fc\u30c9\u3092\u6539\u5584\u3057\u305f\u3044\u300d\u2014\u2014\u5f0a\u793eAI\u9b3c\u7ba1\u7406\u3067\u306f\u3001Claude Code\u3092\u6d3b\u7528\u3057\u305f\u696d\u52d9VBA\u30de\u30af\u30ed\u306e\u958b\u767a\u30fb\u81ea\u52d5\u5316\u652f\u63f4\u3092\u63d0\u4f9b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"balloon-wrap is-right\">\n  <div class=\"balloon-icon\">\n    <img decoding=\"async\" src=\"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-content\/uploads\/2026\/04\/yamazaki-avatar.png\" alt=\"AI\u9b3c\u7ba1\u7406\u5c71\u5d0e\">\n    <span class=\"balloon-name\">AI\u9b3c\u7ba1\u7406\u5c71\u5d0e<\/span>\n  <\/div>\n  <div class=\"balloon-body\">\u6b63\u898f\u8868\u73fe\u30d1\u30bf\u30fc\u30f3\u306e\u8a2d\u8a08\u304b\u3089\u696d\u52d9\u30c7\u30fc\u30bf\u306e\u30af\u30ec\u30f3\u30b8\u30f3\u30b0\u81ea\u52d5\u5316\u307e\u3067\u3001Claude Code\u306a\u3089\u8981\u4ef6\u3092\u4f1d\u3048\u308b\u3060\u3051\u3067\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002\u307e\u305a\u306f\u7121\u6599\u76f8\u8ac7\u3067\u3001\u73fe\u72b6\u306e\u8ab2\u984c\u3092\u304a\u805e\u304b\u305b\u304f\u3060\u3055\u3044\u3002<\/div>\n<\/div>\n\n\n\n<div style=\"background:linear-gradient(135deg,#1a1a1a 0%,#2a1015 100%);border-radius:16px;padding:36px 32px;margin:48px 0 16px;color:#fff;\">\n  <p style=\"font-size:13px;font-weight:700;color:#dc2626;letter-spacing:2px;margin:0 0 12px;\">NEXT STEP<\/p>\n  <p style=\"font-size:22px;font-weight:800;line-height:1.5;margin:0 0 20px;\">\u3053\u306e\u8a18\u4e8b\u306e\u5185\u5bb9\u3092\u3001\u3042\u306a\u305f\u306e\u30d3\u30b8\u30cd\u30b9\u3067<br>\u5b9f\u8df5\u3057\u3066\u307f\u307e\u305b\u3093\u304b\uff1f<\/p>\n  <div style=\"background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.12);border-radius:12px;padding:24px;max-width:560px;margin:0 auto;\">\n    <p style=\"font-size:13px;color:#dc2626;font-weight:700;margin:0 0 8px;\">AI\u6d3b\u7528\u3092\u81ea\u793e\u3067\u56de\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u305f\u3044\u65b9\u3078<\/p>\n    <p style=\"font-size:20px;font-weight:800;margin:0 0 12px;\">AI\u9b3c\u7ba1\u7406<\/p>\n    <p style=\"font-size:14px;color:rgba(255,255,255,0.75);margin:0 0 20px;line-height:1.7;\">Claude Code\u30fbCowork\u5c0e\u5165\u652f\u63f4\u304b\u3089\u696d\u52d9\u8a2d\u8a08\u30fb\u793e\u5185\u6d78\u900f\u307e\u3067\u5b9f\u8df5\u30d9\u30fc\u30b9\u3067\u4f34\u8d70\u3002\u300c\u81ea\u793e\u3067\u56de\u305b\u308b\u7d44\u7e54\u300d\u309290\u65e5\u3067\u4f5c\u308b\u7d4c\u55b6\u8005\u5411\u3051\u30c8\u30ec\u30fc\u30cb\u30f3\u30b0\u3002<\/p>\n    <div style=\"text-align:center;\">\n      <a href=\"https:\/\/aikanri.genai-ai.co.jp\/?utm_source=blog&utm_medium=article&utm_campaign=cc-vba-regexp&utm_content=next-step-cta\" target=\"_blank\" rel=\"noopener\" style=\"display:inline-block;background:#dc2626;color:#fff;font-weight:700;font-size:15px;padding:14px 32px;border-radius:30px;text-decoration:none;\">AI\u9b3c\u7ba1\u7406\u3092\u8a73\u3057\u304f\u898b\u308b \u2192<\/a>\n    <\/div>\n  <\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\">\u3088\u304f\u3042\u308b\u8cea\u554f<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Q. VBA\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u305f\u3081\u306b\u53c2\u7167\u8a2d\u5b9a\u306f\u5fc5\u8981\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. CreateObject(\"VBScript.RegExp\")\u3092\u4f7f\u3046\u65b9\u6cd5\u3067\u306f\u53c2\u7167\u8a2d\u5b9a\u306f\u4e0d\u8981\u3067\u3059\u3002\u4ed6\u306ePC\u3067\u52d5\u304b\u3059\u914d\u5e03\u30de\u30af\u30ed\u306b\u306f\u3053\u306e\u65b9\u6cd5\u3092\u63a8\u5968\u3057\u307e\u3059\u3002\u958b\u767a\u4e2d\u306bIntelliSense\uff08\u30b3\u30fc\u30c9\u88dc\u5b8c\uff09\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306fVBE\u306e\u300c\u30c4\u30fc\u30eb > \u53c2\u7167\u8a2d\u5b9a\u300d\u3067\u300cMicrosoft VBScript Regular Expressions 5.5\u300d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\u3053\u3068\u3067Dim re As New RegExp\u306e\u65e9\u671f\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Pattern\u3067VBA\u6587\u5b57\u5217\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. VBA\u306e\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3067\u306f\\\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\uff09\u306f\u7279\u5225\u306a\u30a8\u30b9\u30b1\u30fc\u30d7\u6587\u5b57\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\"\\d\"\u3068\u66f8\u304f\u3068Pattern\u6587\u5b57\u5217\u306f\\d\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5+d\uff09\u306b\u306a\u308a\u3001\u6b63\u898f\u8868\u73fe\u306e\u300c\u6570\u5b57\u300d\u30e1\u30bf\u6587\u5b57\u3068\u3057\u3066\u6a5f\u80fd\u3057\u307e\u3059\u3002Python\u3084\u306e\u3088\u3046\u306a\u4e8c\u91cd\u30a8\u30b9\u30b1\u30fc\u30d7\uff08\"\\\\d\"\uff09\u306f\u4e0d\u8981\u3067\u3059\u3002\u305f\u3060\u3057VBA\u306e\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3067\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\"\"\u30682\u3064\u7d9a\u3051\u3066\u66f8\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Global=True\u3068Global=False\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. Global=True\u306b\u3059\u308b\u3068\u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u5bfe\u8c61\u306b\u3057\u307e\u3059\uff08Execute\u306f\u5168\u4ef6\u8fd4\u3057\u3001Replace\u306f\u5168\u4ef6\u7f6e\u63db\uff09\u3002Global=False\u306f\u6700\u521d\u306e\u30de\u30c3\u30c1\u306e\u307f\u3092\u5bfe\u8c61\u306b\u3057\u307e\u3059\u3002\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff08\u4e00\u81f4\u306e\u6709\u7121\u3060\u3051\u78ba\u8a8d\uff09\u306e\u5834\u5408\u306fTest\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044Global\u306f\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002\u6587\u5b57\u5217\u304b\u3089\u5024\u3092\u5168\u4ef6\u62bd\u51fa\u30fb\u5168\u4ef6\u7f6e\u63db\u3059\u308b\u5834\u5408\u306fGlobal=True\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. IgnoreCase=True\u306b\u3057\u3066\u3082\u65e5\u672c\u8a9e\u306e\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306b\u52b9\u679c\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. IgnoreCase\u306f\u82f1\u5b57\uff08A-Z\/a-z\uff09\u306e\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002\u65e5\u672c\u8a9e\uff08\u3072\u3089\u304c\u306a\u30fb\u30ab\u30bf\u30ab\u30ca\u30fb\u6f22\u5b57\uff09\u306b\u306f\u76f4\u63a5\u7684\u306a\u52b9\u679c\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30ab\u30bf\u30ab\u30ca\u3068\u3072\u3089\u304c\u306a\u3092\u540c\u4e00\u8996\u3057\u305f\u3044\u5834\u5408\u306f\u6b63\u898f\u8868\u73fe\u3067\u306f\u5bfe\u5fdc\u3067\u304d\u306a\u3044\u305f\u3081\u3001StrConv\u95a2\u6570\uff08StrConv(text, vbKatakana)\u7b49\uff09\u3067\u4e8b\u524d\u306b\u7d71\u4e00\u3057\u3066\u304b\u3089\u30de\u30c3\u30c1\u30f3\u30b0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. Match\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306eFirstIndex\u306f\u4f55\u756a\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. 0\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\uff080\u30d9\u30fc\u30b9\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff09\u3002\u4e00\u65b9VBA\u306eMid\u95a2\u6570\u306f1\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\u3002FirstIndex\u3092\u4f7f\u3063\u3066Mid\u3067\u6587\u5b57\u3092\u5207\u308a\u51fa\u3059\u5834\u5408\u306fMid(str, m.FirstIndex + 1, m.Length)\u3068+1\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u9055\u3044\u3067\u30d0\u30b0\u304c\u8d77\u304d\u3084\u3059\u3044\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. \u6b63\u898f\u8868\u73fe\u3067\u65e5\u672c\u8a9e\u6587\u5b57\uff08\u3072\u3089\u304c\u306a\u30fb\u30ab\u30bf\u30ab\u30ca\u30fb\u6f22\u5b57\uff09\u306f\u30de\u30c3\u30c1\u3067\u304d\u307e\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. Unicode\u306e\u7bc4\u56f2\u6307\u5b9a\u3067\u53ef\u80fd\u3067\u3059\u3002\u3072\u3089\u304c\u306a: [\\u3040-\\u309F] \/ \u30ab\u30bf\u30ab\u30ca: [\\u30A0-\\u30FF] \/ \u6f22\u5b57\uff08\u4e00\u822c\u7684\u306a\u7bc4\u56f2\uff09: [\\u4E00-\\u9FFF]\u3002\u305f\u3060\u3057VBScript RegExp\u306eUnicode\u30a8\u30b9\u30b1\u30fc\u30d7\uff08\\uXXXX\uff09\u306e\u30b5\u30dd\u30fc\u30c8\u306f\u5b9f\u88c5\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u305f\u3081\u3001\u52d5\u4f5c\u78ba\u8a8d\u304c\u5fc5\u8981\u3067\u3059\u3002\u5b9f\u7528\u4e0a\u306f\u300c\\S+\u300d\uff08\u975e\u7a7a\u767d\u6587\u5b57\uff09\u3067\u65e5\u672c\u8a9e\u6587\u5b57\u3092\u542b\u3080\u591a\u304f\u306e\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Q. RegExp\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6539\u5584\u3059\u308b\u30b3\u30c4\u306f\u4f55\u3067\u3059\u304b\uff1f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A. \u30eb\u30fc\u30d7\u306e\u4e2d\u3067CreateObject\u3092\u6bce\u56de\u547c\u3070\u305a\u3001\u30eb\u30fc\u30d7\u306e\u5916\u30671\u56de\u3060\u3051\u4f5c\u6210\u3057\u3066\u4f7f\u3044\u56de\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u8907\u96d1\u3059\u304e\u308b\u30d1\u30bf\u30fc\u30f3\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3059\u300210\u4e07\u884c\u4ee5\u4e0a\u306e\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u3001Application.ScreenUpdating=False\u3068Application.Calculation=xlCalculationManual\u3067\u753b\u9762\u66f4\u65b0\u3068\u8a08\u7b97\u3092\u505c\u6b62\u3057\u3066\u304b\u3089\u51e6\u7406\u3059\u308b\u3068\u5927\u5e45\u306b\u901f\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<script type=\"application\/ld+json\">\n{\n  \"@context\": \"https:\/\/schema.org\",\n  \"@type\": \"FAQPage\",\n  \"mainEntity\": [\n    {\n      \"@type\": \"Question\",\n      \"name\": \"VBA\u3067\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3046\u305f\u3081\u306b\u53c2\u7167\u8a2d\u5b9a\u306f\u5fc5\u8981\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"CreateObject(\\\"VBScript.RegExp\\\")\u3092\u4f7f\u3046\u65b9\u6cd5\u3067\u306f\u53c2\u7167\u8a2d\u5b9a\u306f\u4e0d\u8981\u3067\u3059\u3002\u4ed6\u306ePC\u3067\u52d5\u304b\u3059\u914d\u5e03\u30de\u30af\u30ed\u306b\u306f\u3053\u306e\u65b9\u6cd5\u3092\u63a8\u5968\u3057\u307e\u3059\u3002\u958b\u767a\u4e2d\u306bIntelliSense\uff08\u30b3\u30fc\u30c9\u88dc\u5b8c\uff09\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306fVBE\u306e\u300c\u30c4\u30fc\u30eb > \u53c2\u7167\u8a2d\u5b9a\u300d\u3067\u300cMicrosoft VBScript Regular Expressions 5.5\u300d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u308b\u3053\u3068\u3067Dim re As New RegExp\u306e\u65e9\u671f\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u304c\u4f7f\u3048\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Pattern\u3067VBA\u6587\u5b57\u5217\u306e\u30a8\u30b9\u30b1\u30fc\u30d7\u306f\u3069\u3046\u3059\u308c\u3070\u3044\u3044\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"VBA\u306e\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3067\u306f\\\\\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5\uff09\u306f\u7279\u5225\u306a\u30a8\u30b9\u30b1\u30fc\u30d7\u6587\u5b57\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u305d\u306e\u305f\u3081\\\"\\\\d\\\"\u3068\u66f8\u304f\u3068Pattern\u6587\u5b57\u5217\u306f\\\\d\uff08\u30d0\u30c3\u30af\u30b9\u30e9\u30c3\u30b7\u30e5+d\uff09\u306b\u306a\u308a\u3001\u6b63\u898f\u8868\u73fe\u306e\u300c\u6570\u5b57\u300d\u30e1\u30bf\u6587\u5b57\u3068\u3057\u3066\u6a5f\u80fd\u3057\u307e\u3059\u3002Python\u3084\u306e\u3088\u3046\u306a\u4e8c\u91cd\u30a8\u30b9\u30b1\u30fc\u30d7\uff08\\\"\\\\\\\\d\\\"\uff09\u306f\u4e0d\u8981\u3067\u3059\u3002\u305f\u3060\u3057VBA\u306e\u6587\u5b57\u5217\u30ea\u30c6\u30e9\u30eb\u3067\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8\u3092\u4f7f\u3044\u305f\u3044\u5834\u5408\u306f\\\"\\\"\u30682\u3064\u7d9a\u3051\u3066\u66f8\u304d\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Global=True\u3068Global=False\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Global=True\u306b\u3059\u308b\u3068\u6587\u5b57\u5217\u4e2d\u306e\u5168\u30de\u30c3\u30c1\u3092\u5bfe\u8c61\u306b\u3057\u307e\u3059\uff08Execute\u306f\u5168\u4ef6\u8fd4\u3057\u3001Replace\u306f\u5168\u4ef6\u7f6e\u63db\uff09\u3002Global=False\u306f\u6700\u521d\u306e\u30de\u30c3\u30c1\u306e\u307f\u3092\u5bfe\u8c61\u306b\u3057\u307e\u3059\u3002\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\uff08\u4e00\u81f4\u306e\u6709\u7121\u3060\u3051\u78ba\u8a8d\uff09\u306e\u5834\u5408\u306fTest\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044Global\u306f\u5f71\u97ff\u3057\u307e\u305b\u3093\u3002\u6587\u5b57\u5217\u304b\u3089\u5024\u3092\u5168\u4ef6\u62bd\u51fa\u30fb\u5168\u4ef6\u7f6e\u63db\u3059\u308b\u5834\u5408\u306fGlobal=True\u304c\u5fc5\u8981\u3067\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"IgnoreCase=True\u306b\u3057\u3066\u3082\u65e5\u672c\u8a9e\u306e\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u306b\u52b9\u679c\u306f\u3042\u308a\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"IgnoreCase\u306f\u82f1\u5b57\uff08A-Z\/a-z\uff09\u306e\u5927\u6587\u5b57\u30fb\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044\u304b\u3069\u3046\u304b\u3092\u5236\u5fa1\u3057\u307e\u3059\u3002\u65e5\u672c\u8a9e\uff08\u3072\u3089\u304c\u306a\u30fb\u30ab\u30bf\u30ab\u30ca\u30fb\u6f22\u5b57\uff09\u306b\u306f\u76f4\u63a5\u7684\u306a\u52b9\u679c\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u30ab\u30bf\u30ab\u30ca\u3068\u3072\u3089\u304c\u306a\u3092\u540c\u4e00\u8996\u3057\u305f\u3044\u5834\u5408\u306f\u6b63\u898f\u8868\u73fe\u3067\u306f\u5bfe\u5fdc\u3067\u304d\u306a\u3044\u305f\u3081\u3001StrConv\u95a2\u6570\uff08StrConv(text, vbKatakana)\u7b49\uff09\u3067\u4e8b\u524d\u306b\u7d71\u4e00\u3057\u3066\u304b\u3089\u30de\u30c3\u30c1\u30f3\u30b0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"Match\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306eFirstIndex\u306f\u4f55\u756a\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"0\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\uff080\u30d9\u30fc\u30b9\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff09\u3002\u4e00\u65b9VBA\u306eMid\u95a2\u6570\u306f1\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\u3002FirstIndex\u3092\u4f7f\u3063\u3066Mid\u3067\u6587\u5b57\u3092\u5207\u308a\u51fa\u3059\u5834\u5408\u306fMid(str, m.FirstIndex + 1, m.Length)\u3068+1\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u9055\u3044\u3067\u30d0\u30b0\u304c\u8d77\u304d\u3084\u3059\u3044\u306e\u3067\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"\u6b63\u898f\u8868\u73fe\u3067\u65e5\u672c\u8a9e\u6587\u5b57\uff08\u3072\u3089\u304c\u306a\u30fb\u30ab\u30bf\u30ab\u30ca\u30fb\u6f22\u5b57\uff09\u306f\u30de\u30c3\u30c1\u3067\u304d\u307e\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"Unicode\u306e\u7bc4\u56f2\u6307\u5b9a\u3067\u53ef\u80fd\u3067\u3059\u3002\u3072\u3089\u304c\u306a: [\\\\u3040-\\\\u309F] \/ \u30ab\u30bf\u30ab\u30ca: [\\\\u30A0-\\\\u30FF] \/ \u6f22\u5b57\uff08\u4e00\u822c\u7684\u306a\u7bc4\u56f2\uff09: [\\\\u4E00-\\\\u9FFF]\u3002\u305f\u3060\u3057VBScript RegExp\u306eUnicode\u30a8\u30b9\u30b1\u30fc\u30d7\uff08\\\\uXXXX\uff09\u306e\u30b5\u30dd\u30fc\u30c8\u306f\u5b9f\u88c5\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u305f\u3081\u3001\u52d5\u4f5c\u78ba\u8a8d\u304c\u5fc5\u8981\u3067\u3059\u3002\u5b9f\u7528\u4e0a\u306f\u300c\\\\S+\u300d\uff08\u975e\u7a7a\u767d\u6587\u5b57\uff09\u3067\u65e5\u672c\u8a9e\u6587\u5b57\u3092\u542b\u3080\u591a\u304f\u306e\u30b1\u30fc\u30b9\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u3059\u3002\"\n      }\n    },\n    {\n      \"@type\": \"Question\",\n      \"name\": \"RegExp\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3092\u6539\u5584\u3059\u308b\u30b3\u30c4\u306f\u4f55\u3067\u3059\u304b\uff1f\",\n      \"acceptedAnswer\": {\n        \"@type\": \"Answer\",\n        \"text\": \"\u30eb\u30fc\u30d7\u306e\u4e2d\u3067CreateObject\u3092\u6bce\u56de\u547c\u3070\u305a\u3001\u30eb\u30fc\u30d7\u306e\u5916\u30671\u56de\u3060\u3051\u4f5c\u6210\u3057\u3066\u4f7f\u3044\u56de\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u307e\u305f\u8907\u96d1\u3059\u304e\u308b\u30d1\u30bf\u30fc\u30f3\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u306a\u30d1\u30bf\u30fc\u30f3\u306e\u65b9\u304c\u9ad8\u901f\u3067\u3059\u300210\u4e07\u884c\u4ee5\u4e0a\u306e\u5927\u91cf\u30c7\u30fc\u30bf\u3092\u51e6\u7406\u3059\u308b\u5834\u5408\u306f\u3001Application.ScreenUpdating=False\u3068Application.Calculation=xlCalculationManual\u3067\u753b\u9762\u66f4\u65b0\u3068\u8a08\u7b97\u3092\u505c\u6b62\u3057\u3066\u304b\u3089\u51e6\u7406\u3059\u308b\u3068\u5927\u5e45\u306b\u901f\u304f\u306a\u308a\u307e\u3059\u3002\"\n      }\n    }\n  ]\n}\n<\/script>\n\n\n","protected":false},"excerpt":{"rendered":"<p>VBA\u306e\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09\u3092\u5b8c\u5168\u89e3\u8aac\u3002RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u5b9a\u65b9\u6cd5\u30fbPattern\u306e\u66f8\u304d\u65b9\u30fbExecute\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u30fbReplace\u3067\u7f6e\u63db\u30fbTest\/Matches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u4f7f\u3044\u65b9\u3092\u5b9f\u8df5\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac\u3002\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30fb\u96fb\u8a71\u756a\u53f7\u30fbURL\u306a\u3069\u306e\u62bd\u51fa\u306b\u5373\u4f7f\u3048\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":18371,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sitemap_hide":"","_veu_custom_css":"","vkexunit_cta_each_option":"","footnotes":"","rank_math_description":"VBA\u306e\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09\u3092\u5b8c\u5168\u89e3\u8aac\u3002RegExp\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u8a2d\u5b9a\u65b9\u6cd5\u30fbPattern\u306e\u66f8\u304d\u65b9\u30fbExecute\u3067\u30de\u30c3\u30c1\u30f3\u30b0\u30fbReplace\u3067\u7f6e\u63db\u30fbTest\/Matches\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u306e\u4f7f\u3044\u65b9\u3092\u5b9f\u8df5\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac\u3002\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u30fb\u96fb\u8a71\u756a\u53f7\u30fbURL\u306a\u3069\u306e\u62bd\u51fa\u306b\u5373\u4f7f\u3048\u307e\u3059\u3002","rank_math_focus_keyword":"VBA \u6b63\u898f\u8868\u73fe","rank_math_title":"\u30102026\u5e747\u6708\u6700\u65b0\u3011VBA\u306e\u6b63\u898f\u8868\u73fe\uff08RegExp\uff09\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u6587\u5b57\u5217\u62bd\u51fa\u30fb\u7f6e\u63db\u30fb\u30de\u30c3\u30c1\u30f3\u30b0\u3092\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d\u3067\u89e3\u8aac","pending_rewrite_html":"","pending_rewrite_id":"","pending_rewrite_kw":"","pending_rewrite_at":"","pending_rewrite_source":"","pending_rewrite_brief":"","pending_rewrite_evidence":"","approved_rewrite_html":"","approved_rewrite_id":"","approved_rewrite_kw":"","approved_rewrite_at":"","approved_rewrite_by":"","approved_rewrite_brief":"","approved_rewrite_evidence":"","rewrite_tracker_baseline":"","rewrite_tracker_7day":"","rewrite_tracker_14day":"","rewrite_tracker_30day":"","rewrite_tracker_notified":""},"categories":[3],"tags":[],"class_list":["post-18372","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-automation"],"_links":{"self":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/comments?post=18372"}],"version-history":[{"count":1,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18372\/revisions"}],"predecessor-version":[{"id":18373,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/posts\/18372\/revisions\/18373"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media\/18371"}],"wp:attachment":[{"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/media?parent=18372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/categories?post=18372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genai-ai.co.jp\/ai-kanri\/wp-json\/wp\/v2\/tags?post=18372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}