{"author_name":"tbpg","title":"\u66f8\u7c4d Regular Expressions Cookbook | Insert the Regex Match into the Replacement Text","description":"\u30d1\u30f3\u304f\u305a \u66f8\u7c4d Regular Expressions Cookbook Insert the Regex Match into the Replacement Text \u6982\u8981 \u30de\u30c3\u30c1\u30f3\u30b0\u3057\u305f\u5185\u5bb9\u3092\u5f8c\u65b9\u53c2\u7167\u3067\u7f6e\u63db\u6587\u5b57\u5217\u5185\u306b\u57cb\u3081\u8fbc\u3080\u65b9\u6cd5\u306b\u3064\u3044\u3066 \u69cb\u6587 \u30de\u30c3\u30c1\u5185\u5bb9\u3092\u30b0\u30eb\u30fc\u30d7\u306eindex\u3092\u6307\u5b9a\u3057\u3066\u53d6\u5f97 string.gsub(/(pattern1)(pattern2)(pattern3/, '\\1\\2\\3') \u30b5\u30f3\u30d7\u30eb # \u30de\u30c3\u30c1\u3057\u305f\u7b87\u6240\u3092index\u6307\u5b9a\u3067\u53d6\u5f97 puts \"one two three\".gsub(/(one) (two) (three)/,'\\1-\\2-\\3') #=>\u7f6e\u63db\u5f8c\uff1aone\u2026","type":"rich","provider_name":"Hatena Blog","image_url":null,"provider_url":"https://hatena.blog","blog_title":"Tbpgr Blog","blog_url":"https://tbpgr.hatenablog.com/","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftbpgr.hatenablog.com%2Fentry%2F20120529%2F1338307654\" title=\"\u66f8\u7c4d Regular Expressions Cookbook | Insert the Regex Match into the Replacement Text - Tbpgr Blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","categories":["Regular Expressions Cookbook"],"published":"2012-05-29 01:07:34","author_url":"https://blog.hatena.ne.jp/tbpg/","url":"https://tbpgr.hatenablog.com/entry/20120529/1338307654","height":"190"}