{"id":11692,"date":"2021-10-01T10:40:31","date_gmt":"1970-01-01T00:00:00","guid":{"rendered":"http:\/\/www.sejuku.net\/blog\/?p=11692"},"modified":"2024-05-06T11:39:46","modified_gmt":"2024-05-06T02:39:46","slug":"%e5%bf%98%e3%82%8c%e3%81%9f%e3%82%89%e8%aa%ad%e3%81%bf%e3%81%9f%e3%81%84ruby%e6%ad%a3%e8%a6%8f%e8%a1%a8%e7%8f%be%e3%81%ae%e3%83%a1%e3%82%bd%e3%83%83%e3%83%89%e3%80%81%e4%bd%bf%e3%81%84%e6%96%b9","status":"publish","type":"post","link":"https:\/\/www.sejuku.net\/blog\/11692","title":{"rendered":"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01"},"content":{"rendered":"<p>Ruby\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u521d\u5fc3\u8005\u306b\u3068\u3063\u3066\u3001\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u304c\u3044\u307e\u3044\u3061\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3068\u611f\u3058\u3066\u3044\u308b\u4eba\u3082\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p><div class=\"box_voice\"><b>\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044<br \/>\n\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u3092\u3059\u3050\u306b\u5fd8\u308c\u3066\u3057\u307e\u3046<\/b><\/div><\/p>\n<p>\u305d\u3093\u306a\u6b63\u898f\u8868\u73fe\u3092\u308f\u304b\u308a\u3084\u3059\u304f\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u672c\u8a18\u4e8b\u3067\u306f\u89e3\u8aac\u3092\u9032\u3081\u3066\u3044\u304d\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001<\/p>\n<div class=\"box01\">\n<ul>\n<li><b>\u3010\u57fa\u790e\u3011\u305d\u3082\u305d\u3082\u6b63\u898f\u8868\u73fe\u3068\u306f\uff1f<\/b><\/li>\n<li><b>\u3010\u57fa\u790e\u3011\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30bf\u30fc\u30f3\u4e00\u89a7<\/b><\/li>\n<li><b>\u3010\u5b9f\u8df5\u3011\u6b63\u898f\u8868\u73fe\u3067\u6587\u5b57\u5217\u306a\u3069\u306e\u62bd\u51fa\u3092\u884c\u3046\u306b\u306f\uff1f<\/b><\/li>\n<li><b>\u3010\u5b9f\u8df5\u3011\u6b63\u898f\u8868\u73fe\u3067\u7f6e\u63db\u51e6\u7406\u3092\u884c\u3046\u306b\u306f\uff1f<\/b><\/li>\n<\/ul>\n<\/div>\n<p>\u306a\u3069\u3001\u3088\u308a\u5b9f\u8df5\u7684\u3067\u5177\u4f53\u7684\u306a\u5185\u5bb9\u307e\u3067\u5e45\u5e83\u304f\u89e3\u8aac\u3092\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u305c\u3072\u3001\u3053\u306e\u6a5f\u4f1a\u306b\u6b63\u898f\u8868\u73fe\u3092\u30de\u30b9\u30bf\u30fc\u3057\u3001\u4f7f\u3044\u3053\u306a\u305b\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u305d\u3082\u305d\u3082\u6b63\u898f\u8868\u73fe\u3068\u306f\uff1f<\/h2>\n<p>\u6b63\u898f\u8868\u73fe\u3068\u306f\u3001\u308f\u304b\u308a\u3084\u3059\u304f\u5b9a\u7fa9\u3059\u308b\u3068\u3001<b>\u3042\u308b\u4e00\u5b9a\u306e\u898f\u5247\u3067\u4e26\u3093\u3067\u3044\u308b\u6587\u5b57\u5217\u3092\u691c\u51fa\u3059\u308b\u305f\u3081\u306e\u6280\u8853<\/b>\u306e\u3053\u3068\u3067\u3059\u3002\u6b63\u898f\u8868\u73fe\u3063\u3066\u305d\u3082\u305d\u3082\u306a\u3093\u3060\u308d\u3046\u3001\u4f55\u3092\u3059\u308b\u305f\u3081\u306e\u3082\u306e\uff1f\u3068\u3044\u3046\u65b9\u306f\u307e\u305a\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/11614\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/10\/eyecatch_template-20-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u7406\u89e3\u3057\u3065\u3089\u3044Ruby\u306e\u6b63\u898f\u8868\u73fe\u3068\u306f\uff1f\u301c\u57fa\u790e\u306e\u57fa\u790e\u3092\u77e5\u308d\u3046\u301c<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            <\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u7528\u3044\u3066\u3001\u5177\u4f53\u7684\u306a\u4f7f\u3044\u65b9\u3092\u5b66\u7fd2\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u6b63\u898f\u8868\u73fe\u3067\u6587\u5b57\u5217\u306a\u3069\u306e\u62bd\u51fa\u3092\u884c\u3046\u306b\u306f\uff1f<\/h2>\n<p>\u3053\u3053\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u3067\u6587\u5b57\u5217\u306e\u62bd\u51fa\u3092\u884c\u3046\u3001<br \/>\n<div class=\"box01\"><\/p>\n<ul>\n<li><b>match<\/b><\/li>\n<li><b>pre_match<\/b><\/li>\n<li><b>post_match<\/b><\/li>\n<li><b>slice, slice!<\/b><\/li>\n<\/ul>\n<p><\/div><br \/>\n\u306b\u3064\u3044\u3066\u7d39\u4ecb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h3>match\uff08\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u3092\u53d6\u5f97\u3059\u308b\uff09<\/h3>\n<p>match\u30e1\u30bd\u30c3\u30c9\u306f\u6b63\u898f\u8868\u73fe\u306b\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3059\u308b\u3068\u304d\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u540d .match(\/\u6b63\u898f\u8868\u73fe\/)<\/pre>\n<p>\u4ee5\u4e0b\u306e\u4f8b\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u3067\u300c*\u306e\u52c9\u5f37\u300d\u306b\u30de\u30c3\u30c1\u3059\u308b\u6587\u5b57\u5217\u3092\u53d6\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>string = \"Ruby\u306e\u52c9\u5f37, Rails\u306e\u5b66\u7fd2\"\r\nmd = string.match(\/.*\u306e\u52c9\u5f37\/)\r\np md[0]\r\n=&gt; \"Ruby\u306e\u52c9\u5f37\"\r\n\r\nstring = \"Ruby\u306e\u52c9\u5f37, Rails\u306e\u52c9\u5f37\"\r\nmd = string.match(\/.*\u306e\u52c9\u5f37\/)\r\np md[0]\r\n=&gt; \"Ruby\u306e\u52c9\u5f37, Rails\u306e\u52c9\u5f37\"\r\n<\/pre>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u4f7f\u7528\u3055\u308c\u3066\u3044\u308b\u300c*\u300d\u306f\u3001\u691c\u7d22\u6587\u5b57\u5217\u3092\u542b\u3080\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3059\u308b\u3068\u304d\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002match\u30e1\u30bd\u30c3\u30c9\u306e\u8a73\u3057\u3044\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u306f\u3001\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u3082\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/57417\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2018\/06\/image7-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u306f\u3058\u3081\u3066\u306eRuby\uff01match\u30e1\u30bd\u30c3\u30c9\u3067\u6b63\u898f\u8868\u73fe\u306b\u3088\u308b\u30de\u30c3\u30c1\u30f3\u30b0<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            <\/p>\n<h3>pre_match\uff08\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u524d\u3092\u53d6\u308a\u51fa\u3059\uff09<\/h3>\n<p>pre_match\u306f\u6b63\u898f\u8868\u73fe\u306b\u30de\u30c3\u30c1\u3057\u305f\u524d\u306e\u90e8\u5206\u306e\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre>reg = \/\u306e\u52c9\u5f37\/.match(\"Rails\u306e\u52c9\u5f37\u3092\u3057\u3088\u3046\")\r\np reg.pre_match\r\n=&gt; \"Rails\"\r\n<\/pre>\n<h3>post_match\uff08\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u5f8c\u3092\u53d6\u308a\u51fa\u3059\uff09<\/h3>\n<p>post_match\u306f\u6b63\u898f\u8868\u73fe\u306b\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u5f8c\u306e\u6587\u5b57\u5217\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre>reg = \/\u306e\u52c9\u5f37\/.match(\"Rails\u306e\u52c9\u5f37\u3092\u3057\u3088\u3046\")\r\np reg.post_match\r\n=&gt; \"\u3092\u3057\u3088\u3046\"\r\n<\/pre>\n<h3>slice, slice!\uff08\u30de\u30c3\u30c1\u3057\u305f\u6587\u5b57\u5217\u3092\u53d6\u308a\u51fa\u3059\uff09<\/h3>\n<p>slice\u306f\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u6587\u5b57\u5217\u3092\u53d6\u308a\u51fa\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u4f8b\u3067\u306fa\u304b\u3089\u59cb\u307e\u308b\u6700\u521d\u306e\u6587\u5b57\u3092\u53d6\u308a\u51fa\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre>p \"xxxabcxxxx\".slice(\/a..\/)\r\n=&gt; \"abc\"\r\n\r\n\u30de\u30c3\u30c1\u3057\u306a\u3044\u5834\u5408\u306fnil\u3092\u8fd4\u3059\r\np \"xxxxxxx\".slice(\/a..\/)\r\n=&gt; nil\r\n\r\nslice!\u306f\u30ec\u30b7\u30fc\u30d0\u304b\u3089\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u3092\u524a\u9664\u3057\u307e\u3059\u3002\r\na = \"xxxxaaaxxx\"\r\na.slice!(\/a..\/)\r\n=&gt; \"aaa\"\r\np a\r\n=&gt; \"xxxxxx\"\r\n<\/pre>\n<p>\u4f7f\u7528\u4f8b<\/p>\n<h3>=~\uff08\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u8fd4\u3059\uff09<\/h3>\n<p><b>=~<\/b>\u3092\u4f7f\u7528\u3059\u308b\u3068\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u306e\u6700\u521d\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre> \r\np \/aaa\/ =~ \"aaabbb\"\r\n=&gt; 0\r\np \/aaa\/ =~ \"rubyaaa\"\r\n=&gt; 4\r\n\u30de\u30c3\u30c1\u3057\u306a\u3044\u5834\u5408\u306fnil\u3092\u8fd4\u3059\r\np \/aaa\/ =~ \"ruby\"\r\n=&gt; nil\r\n<\/pre>\n<h3>!~ (\u30de\u30c3\u30c1\u3057\u306a\u304b\u3063\u305f\u3089true\u3092\u8fd4\u3059)<\/h3>\n<p><b>!~<\/b>\u3092\u4f7f\u7528\u3059\u308b\u3068\u6b63\u898f\u8868\u73fe\u3067\u30de\u30c3\u30c1\u3057\u306a\u304b\u305f\u3089true\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">p \/aaa\/ !~ \"aaabbb\"\r\n=&gt; false\r\np \/aaa\/ !~ \"rubyaaa\"\r\n=&gt; false\r\n\u30de\u30c3\u30c1\u3057\u306a\u3044\u5834\u5408\u306ftrue\u3092\u8fd4\u3059\r\np \/aaa\/ !~ \"ruby\"\r\n=&gt; true<\/pre>\n<h3>scan\uff08\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u3092\u3059\u3079\u3066\u914d\u5217\u3067\u8fd4\u3059\uff09<\/h3>\n<p>scan\u306f\u6b63\u898f\u8868\u73fe\u3067\u30de\u30c3\u30c1\u3057\u305f\u90e8\u5206\u3092\u53d6\u5f97\u3057\u3066\u914d\u5217\u3067\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<pre>\u300c\u3007\u3007by\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u306b\u30de\u30c3\u30c1\u3057\u305f\u3082\u306e\u3092\u5168\u3066\u8fd4\u3059\r\nstring = \"of the ruby, by the ruby, for the ruby\"\r\np string.scan(\/..by\/)\r\n=&gt; [\"ruby\", \", by\", \"ruby\", \"ruby\"]\r\n<\/pre>\n<h2>\u6b63\u898f\u8868\u73fe\u3067\u7f6e\u63db\u51e6\u7406\u3092\u884c\u3046\u306b\u306f\uff1f<\/h2>\n<p>\u7f6e\u63db\u51e6\u7406\u3068\u306f\u3001\u3042\u308b\u5bfe\u8c61\u3092\u5225\u306e\u5bfe\u8c61\u306b\u7f6e\u304d\u63db\u3048\u308b\u51e6\u7406\u3068\u306a\u308a\u307e\u3059\u3002\u305d\u306e\u3042\u308b\u5bfe\u8c61\u3092\u4e00\u81f4\u3057\u305f\u5168\u3066\u306e\u7b87\u6240\u306b\u5bfe\u3057\u3066\u7f6e\u63db\u3059\u308b\u304b\u3001\u6700\u521d\u306b\u4e00\u81f4\u3057\u305f\u7b87\u6240\u306e\u307f\u7f6e\u63db\u3059\u308b\u304b\u3001\u305d\u306e\u51e6\u7406\u3057\u305f\u3044\u5185\u5bb9\u306b\u5fdc\u3058\u305f\u30e1\u30bd\u30c3\u30c9\u304cRuby\u306b\u306f\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>gsub, gsub!\uff08\u4e00\u81f4\u3057\u305f\u90e8\u5206\u3092\u5168\u3066\u7f6e\u304d\u63db\u3048\u308b\uff09<\/h3>\n<p>\u3042\u308b\u5bfe\u8c61\u3092\u4e00\u81f4\u3057\u305f\u5168\u3066\u306e\u7b87\u6240\u306b\u5bfe\u3057\u3066\u7f6e\u63db\u3057\u305f\u3044\u5834\u5408\u306f\u3001gsub\u3001gsub!\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9\u306f\u4ee5\u4e0b\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">\u7f6e\u63db\u5bfe\u8c61.gsub(\/\u7f6e\u63db\u3057\u305f\u3044\u6587\u5b57\/,\u7f6e\u304d\u63db\u3048\u308b\u6587\u5b57)<\/pre>\n<p>gsub\u3068gsub!\u306e\u9055\u3044\u306f\u3001<b>\u7f6e\u63db\u5bfe\u8c61\u306b\u5bfe\u3057\u3066\u7f6e\u63db\u5f8c\u306e\u5185\u5bb9\u306b\u4e0a\u66f8\u304d\u3059\u308b\u304b\u3057\u306a\u3044\u304b<\/b>\u306e\u9055\u3044\u3068\u306a\u308a\u307e\u3059\u3002\u5177\u4f53\u7684\u306a\u4f7f\u3044\u65b9\u3068\uff12\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u9055\u3044\u3092\u4ee5\u4e0b\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">#gsub\r\ntarget = \"hello, hello, hello Ruby\"\r\nputs target.gsub(\/hello\/, \"morning\")\r\nputs target\r\n\r\n#gsub!\r\ntarget2 = \"hello, hello, hello Rails\"\r\nputs target2.gsub!(\/hello\/, \"morning\")\r\nputs target2<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \"># gsub\r\nmorning, morning, morning Ruby\r\nhello, hello, hello Ruby\r\n# gsub!\r\nmorning, morning, morning Rails\r\nmorning, morning, morning Rails<\/pre>\n<p>gsub\u30e1\u30bd\u30c3\u30c9\u3082gsub!\u30e1\u30bd\u30c3\u30c9\u3082\u7f6e\u63db\u3057\u305f\u7d50\u679c\u306f\u540c\u3058\u3067\u3059\u304c\u3001\u5143\u306e\u5bfe\u8c61(target,target2)\u306e\u30c7\u30fc\u30bf\u3082\u7f6e\u63db\u5f8c\u306e\u5185\u5bb9\u3067\u4e0a\u66f8\u304d\u3055\u308c\u308b\u304b\u3055\u308c\u306a\u3044\u304b\u306e\u9055\u3044\u304c\u3042\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h3>sub, sub!\uff08\u4e00\u81f4\u3057\u305f\u6700\u521d\u306e\u90e8\u5206\u3092\u7f6e\u304d\u63db\u3048\u308b\uff09<\/h3>\n<p>\u6b21\u306b\u4e00\u81f4\u3057\u305f\u6700\u521d\u306e\u90e8\u5206\u3060\u3051\u3092\u7f6e\u304d\u63db\u3048\u308b\u30e1\u30bd\u30c3\u30c9\u3067\u3059\u3002\u305d\u308c\u304c\u3001sub,sub!\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a182\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u306e\u9055\u3044\u306f\u3001\u3055\u304d\u307b\u3069gsub\u306e\u9805\u76ee\u3067\u3054\u8aac\u660e\u3057\u305f\u5185\u5bb9\u3068\u540c\u3058\u304f\u3001\u5143\u306e\u30c7\u30fc\u30bf\u3092\u4e0a\u66f8\u304d\u3059\u308b\u304b\u3057\u306a\u3044\u304b\u306e\u9055\u3044\u3067\u3059\u3002\u3053\u3061\u3089\u3082\u5177\u4f53\u7684\u306a\u30b5\u30f3\u30d7\u30eb\u3067\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">#sub\r\ntarget = \"hello, hello, hello Ruby\"\r\nputs target.sub(\/hello\/, \"morning\")\r\nputs target\r\n\r\n#sub!\r\ntarget2 = \"hello, hello, hello Rails\"\r\nputs target2.sub!(\/hello\/, \"morning\")\r\nputs target2<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">#sub\r\nmorning, hello, hello Ruby\r\nhello, hello, hello Ruby\r\n#sub!\r\nmorning, hello, hello Rails\r\nmorning, hello, hello Rails<\/pre>\n<p>\u4e0a\u306e\u30b5\u30f3\u30d7\u30eb\u3067\u78ba\u8a8d\u9802\u3044\u305f\u69d8\u306b\u3001\u6700\u521d\u306b\u4e00\u81f4\u3057\u305f\u7b87\u6240\u306e\u6587\u5b57\u3060\u3051\u7f6e\u63db\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n<h2>\u6b63\u898f\u8868\u73fe\u3067\u6587\u5b57\u5217\u306a\u3069\u3092\u5206\u5272\u3059\u308b\u306b\u306f\uff1f<\/h2>\n<p>\u6587\u5b57\u5217\u306e\u5206\u5272\u306b\u306fsplit, split!\u30e1\u30bd\u30c3\u30c9\u3092\u5229\u7528\u3057\u307e\u3059\u3002\u4e0a\u8a18\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3053\u3068\u3067\u5f97\u3089\u308c\u308b\u7d50\u679c\uff08\u623b\u308a\u5024\uff09\u306f\u914d\u5217\u3068\u306a\u308a\u307e\u3059\u3002\u3053\u3061\u3089\u3082\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"Hello, Ruby, World\"\r\np string.split(\/s*,s*\/) # \u300c,\u300d\u3067\u5206\u5272<\/pre>\n<p>\u5b9f\u884c\u7d50\u679c<\/p>\n<pre class=\"striped:false marking:false ranges:false nums:false nums-toggle:false lang:default decode:true \">[\"Hello\", \"Ruby\", \"World\"]<\/pre>\n<p>\u914d\u5217\u306b\u3064\u3044\u3066\u3001\u3053\u306e\u6a5f\u4f1a\u306b\u7406\u89e3\u3092\u6df1\u3081\u3066\u304a\u304d\u305f\u3044\u65b9\u306f\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/15120\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2017\/02\/image2-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u3010Ruby\u306e\u914d\u5217\u3011\u57fa\u790e\u304b\u3089\u767a\u5c55\u307e\u3067\u3092\u7db2\u7f85\u3057\u307e\u3057\u305f\uff01<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2024\u5e745\u67086\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            \n<h2>\u30e1\u30bf\u6587\u5b57\u5217\u306e\u4f7f\u3044\u65b9<\/h2>\n<h3>\u30e1\u30bf\u6587\u5b57\u5217\u306e\u4e00\u89a7<\/h3>\n<p>\u30e1\u30bf\u6587\u5b57\u3068\u306f\u672c\u6765\u3082\u3064\u6587\u5b57\u306e\u610f\u5473\u3068\u306f\u5225\u306b\u3001\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u884c\u3046\u4e0a\u3067\u5b9a\u7fa9\u3057\u305f\u7279\u5225\u306a\u610f\u5473\u3092\u6301\u3064\u6587\u5b57\u5217\u306e\u3053\u3068\u3092\u30e1\u30bf\u6587\u5b57\u3068\u547c\u3073\u307e\u3059\u3002<\/p>\n<p>\u7279\u306b\u6b63\u898f\u8868\u73fe\u306e\u51e6\u7406\u3067\u306f\u3001\u3053\u306e\u30e1\u30bf\u6587\u5b57\u5217\u304c\u3068\u3066\u3082\u5f37\u529b\u306a\u6b66\u5668\u3068\u306a\u308a\u307e\u3059\u3002\u307e\u305a\u306f\u3001\u4ee5\u4e0b\u306e\u30e1\u30bf\u6587\u5b57\u5217\u306e\u4e00\u89a7\u3092\u3054\u78ba\u8a8d\u4e0b\u3055\u3044\u3002<\/p>\n\n<table id=\"tablepress-241\" class=\"tablepress tablepress-id-241\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">\u30e1\u30bf\u6587\u5b57<\/th><th class=\"column-2\">\u8aac\u660e<\/th><th class=\"column-3\">\u4f7f\u7528\u4f8b<\/th><th class=\"column-4\">\u5408\u81f4\u3059\u308b\u6587\u5b57\u5217<\/th><th class=\"column-5\">\u5408\u81f4\u3057\u306a\u3044\u6587\u5b57\u5217<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">.<\/td><td class=\"column-2\">\u4efb\u610f\u306e1\u6587\u5b57<\/td><td class=\"column-3\">h.t<\/td><td class=\"column-4\">hat,hot,hit<\/td><td class=\"column-5\">head,height<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">*<\/td><td class=\"column-2\">\u76f4\u524d\u306e\u30d1\u30bf\u30fc\u30f3\u30920\u56de\u4ee5\u4e0a\u7e70\u308a\u8fd4\u3059<\/td><td class=\"column-3\">\u5c71\u5ddd*<\/td><td class=\"column-4\">\u5c71,\u5c71\u5ddd,\u5c71\u5ddd\u5ddd<\/td><td class=\"column-5\">\u91cc<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">+<\/td><td class=\"column-2\">\u76f4\u524d\u306e\u30d1\u30bf\u30fc\u30f3\u3092\uff11\u56de\u4ee5\u4e0a\u7e70\u308a\u8fd4\u3059<\/td><td class=\"column-3\">gre*n<\/td><td class=\"column-4\">greeeeeeen<\/td><td class=\"column-5\">grn<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">?<\/td><td class=\"column-2\">\u76f4\u524d\u306e\u30d1\u30bf\u30fc\u30f3\u30920\u3082\u3057\u304f\u306f1\u56de\u7e70\u308a\u8fd4\u3059<\/td><td class=\"column-3\">\u5c71\u5ddd?<\/td><td class=\"column-4\">\u5c71,\u5c71\u5ddd<\/td><td class=\"column-5\">\u5c71\u5ddd\u5ddd<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">{\u6570\u5b57}<\/td><td class=\"column-2\">\u76f4\u524d\u306e\u30d1\u30bf\u30fc\u30f3\u3092\u6570\u5b57\u306e\u5206\u3060\u3051\u7e70\u308a\u8fd4\u3057<\/td><td class=\"column-3\">9{3}<\/td><td class=\"column-4\">999<\/td><td class=\"column-5\">9,99,9999<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">[\u6587\u5b57,\u6587\u5b57]<\/td><td class=\"column-2\">\u30ab\u30c3\u30b3\u5185\u306e\u6587\u5b57\u306e\u3044\u305a\u308c\u304b\uff11\u6587\u5b57<\/td><td class=\"column-3\">[a,b,c]<\/td><td class=\"column-4\">a,b,c<\/td><td class=\"column-5\">d,e<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-241 from cache -->\n<p>\u6b21\u306b\u5229\u7528\u983b\u5ea6\u306e\u9ad8\u3044\u30e1\u30bf\u6587\u5b57\u306e\u4f7f\u7528\u4f8b\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3>\u7e70\u308a\u8fd4\u3057\u306e\u8868\u73fe<\/h3>\n<p>0\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057\u3067\u306f&#8221;*&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"bbb\"\r\np string.gsub(\/a*b\/, \"morning \")\r\n=&gt; \"morning morning morning\"\r\n\r\nstring = \"abbbabbaaaaab\"\r\np string.gsub(\/a*b\/, \"morning \")\r\n=&gt; \"morning morning morning morning morning morning \"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">b\r\nab\r\naab<\/pre>\n<p>0\u56de\u4ee5\u4e0a\u3068\u3044\u3046\u3053\u3068\u306fa\u304c\u3042\u3063\u3066\u3082\u306a\u304f\u3066\u3082\u3044\u3044\u306e\u3067b\u3067\u3082\u4e00\u81f4\u3059\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>1\u56de\u4ee5\u4e0a\u306e\u7e70\u308a\u8fd4\u3057\u3067\u306f&#8221;+&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"bbb\"\r\np string.gsub(\/a+b\/, \"morning \")\r\n=&gt; \"bbb\"\r\n\r\nstring = \"abbbabbaaaaa\"\r\np string.gsub(\/a+b\/, \"morning \")\r\n=&gt; \"morning bbmorning baaaaa\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">ab\r\naab\r\naaab<\/pre>\n<p>1\u56de\u4ee5\u4e0a\u306a\u306e\u3067\u3001b\u3060\u3051\u3067\u306f\u4e00\u81f4\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c0\u56de\u304b1\u56de\u306e\u3068\u304d\u306f&#8221;?&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"bbb\"\r\np string.gsub(\/a?b\/, \"morning \")\r\n=&gt; \"morning morning morning \"\r\n\r\nstring = \"aab\"\r\np string.gsub(\/a?b\/, \"morning \")\r\n=&gt; \"amorning \"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">b\r\nab<\/pre>\n<p>0,1\u56de\u306a\u306e\u3067\u3001aaab\u306a\u3069\u306f\u4e00\u81f4\u3057\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304c\u3061\u3087\u3046\u3069n\u56de\u306e\u3068\u304d\u306f{n}\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"bbb\"\r\np string.gsub(\/b{3}\/, \"morning \")\r\n=&gt; \"morning \"\r\n\r\nstring = \"bb\"\r\np string.gsub(\/b{3}\/, \"morning \")\r\n=&gt; \"bb\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">bbb<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u3061\u3087\u3046\u3069bbb\u304c3\u56de\u306e\u3068\u304d\u3057\u304b\u30de\u30c3\u30c1\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304cn\u56de\u4ee5\u4e0a\u306e\u3068\u304d\u306f{n,}\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"bbb\"\r\np string.gsub(\/b{2,}\/, \"morning \")\r\n=&gt; \"morning \"\r\n\r\nstring = \"bb\"\r\np string.gsub(\/b{2,}\/, \"morning \")\r\n=&gt; \"morning \"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">bb\r\nbbb\r\nbbbb\r\nbbbbb<\/pre>\n<p>\u4ee5\u4e0a\u306a\u306e\u3067\u3001\u969b\u9650\u306a\u304f\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304cn\u56de\u4ee5\u4e0b\u306e\u3068\u304d\u306f{,n}\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"abbb\"\r\np string.gsub(\/ab{,2}\/, \"morning \")\r\n=&gt; \"morning b\"\r\n\r\nstring = \"a\"\r\np string.gsub(\/ab{,2}\/, \"morning \")\r\n=&gt; \"morning \"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">a\r\nab\r\nabb<\/pre>\n<p>n\u56de\u4ee5\u4e0b\u306a\u306e\u3067\u3001b\u304c\u6d88\u3048\u3066a\u3060\u3051\u306e\u3068\u304d\u3082\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<p>\u7e70\u308a\u8fd4\u3057\u56de\u6570\u304cn\u56de\u4ee5\u4e0a\u3001m\u56de\u4ee5\u4e0b\u306e\u3068\u304d\u306f{n,m}\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"xxxxabxxx\"\r\np string.gsub(\/ab{1,2}\/, \"morning\")\r\n=&gt; \"xxxxmorningxxx\"\r\n\r\nstring = \"xxxxabbbxxxx\"\r\np string.gsub(\/ab{1,2}\/, \"morning\")\r\n=&gt; \"xxxxmorningbxxxx\"\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">ab\r\nabb<\/pre>\n<p>1\u56de\u304b2\u56de\u306e\u3069\u3061\u3089\u3082\u30de\u30c3\u30c1\u3059\u308b\u3068\u304d\u306f\u6700\u5927\u5024\u306e2\u3067\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<h3>\u6587\u5b57\u30af\u30e9\u30b9\u306e\u7701\u7565\u8a18\u6cd5<\/h3>\n<p>a-z\u3001A-Z\u30010-9\u306e\u3046\u3061\u306e\u3044\u305a\u308c\u304b1\u6587\u5b57\u306b\u4e00\u81f4\u3059\u308b\u5834\u5408\u306fw\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"9a\"\r\np string.gsub(\/wa\/, \"morning\")\r\n=&gt; \"morning\"\r\n\r\nstring = \"Za\"\r\np string.gsub(\/wa\/, \"morning\")\r\n=&gt; \"morning\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">2a\r\n0a\r\nja\r\nia\r\nOa<\/pre>\n<p>\u8981\u3059\u308b\u306b\u82f1\u6570\u5b57\u306f\u3059\u3079\u3066\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<p>\u53cd\u5bfe\u306ba-z\u3001A-Z\u30010-9\u306e\u3046\u3061\u306e\u3044\u305a\u308c\u306e1\u6587\u5b57\u306b\u3082\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u306fW\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"\u6691a\"\r\np string.gsub(\/Wa\/, \"morning\")\r\n=&gt; \"morning\"\r\n\r\nstring = \"na\"\r\np string.gsub(\/Wa\/, \"morning\")\r\n=&gt; \"morning\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">n\r\nf\r\n\u611f\r\n\u7c73<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u82f1\u6570\u5b57\u4ee5\u5916\u306f\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<p>\u7a7a\u767d\u6587\u5b57\u306bf,n,r,t\u306b\u4e00\u81f4\u3059\u308b\u5834\u5408\u306fs\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"ra\"\r\np string.gsub(\/sa\/, \"morning\")\r\n=&gt; \"morning\"\r\n\r\nstring = \"na\"\r\np string.gsub(\/sa\/, \"morning\")\r\n=&gt; \"morning\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">n\r\nf\r\nn\r\nr<\/pre>\n<p>\u53cd\u5bfe\u306b\u7a7a\u767d\u6587\u5b57\u306bf,n,r,t\u306b\u4e00\u81f4\u3057\u306a\u3044\u5834\u5408\u306fS\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"Aa\"\r\np string.gsub(\/Sa\/, \"morning\")\r\n=&gt; \"morning\"\r\n\r\nstring = \"0a\"\r\np string.gsub(\/Sa\/, \"morning\")\r\n=&gt; \"morning\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">A\r\ns\r\n0\r\nK<\/pre>\n<p>10\u9032\u6570\u306e\u6570\u5b57\u306b\u4e00\u81f4\u3059\u308b\u5834\u5408\u306f&#8221;d&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"Aa\"\r\np string.gsub(\/da\/, \"morning\")\r\n=&gt; \"Aa\"\r\n\r\nstring = \"0323-3238-3232\"\r\np string.gsub(\/d{4}\/, \"morning\")\r\n=&gt; \"morning-morning-morning\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">3\r\n4\r\n0<\/pre>\n<p>10\u9032\u6570\u306e\u6570\u5b57\u4ee5\u5916\u306b\u4e00\u81f4\u3059\u308b\u5834\u5408\u306f&#8221;D&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"#a\"\r\np string.gsub(\/Da\/, \"morning\")\r\n=&gt; \"morning\"\r\n\r\nstring = \"9a\"\r\np string.gsub(\/Da\/, \"morning\")\r\n=&gt; \"9a\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">j\r\ni\r\n#<\/pre>\n<p>\u8981\u3059\u308b\u306b\u3001\u6570\u5b57\u4ee5\u5916\u306f\u306a\u3093\u3067\u3082\u30de\u30c3\u30c1\u3057\u307e\u3059\u3002<\/p>\n<h3>\u6587\u5b57\u5217\u306e\u884c\u982d\u3001\u884c\u672b\u3001\u5148\u982d\u3001\u672b\u5c3e\u3067\u6307\u5b9a\u3059\u308b\u65b9\u6cd5<\/h3>\n<p>\u30e1\u30bf\u6587\u5b57\u5217\u3067\u306f<b>\u6587\u5b57\u5217\u306e\u4f4d\u7f6e\u3092\u8003\u616e\u3057\u3066\u4e00\u81f4\u3059\u308b\u304b\u3069\u3046\u304b\u5224\u5b9a<\/b>\u3067\u304d\u307e\u3059\u3002\u884c\u982d\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f&#8221;^&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002\u884c\u982d\u306f\u5148\u982d\u3068\u306f\u9055\u3044\u3001n\u3067\u6539\u884c\u3055\u308c\u305f\u3042\u3068\u306e\u5148\u982d\u3082\u542b\u3081\u308b\u306e\u30671\u3064\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"bbbnbbb\"\r\np string.gsub(\/^bbb\/, \"morning\")\r\n=&gt; \"morningn\" + \"morning\"\r\n\r\nstring = \"bbbnbbbnbbb\"\r\np string.gsub(\/^bbb\/, \"morning\")\r\n=&gt; \"morningn\" + \"morningn\" + \"morning\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">\u884c\u982d\u306ebbb<\/pre>\n<p>\u884c\u672b\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f&#8221;$&#8221;\u3092\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"aaabbbnbbbaaa\"\r\np string.gsub(\/bbb$\/, \"morning\")\r\n=&gt;  \"aaamorningn\" + \"bbbaaa\"\r\n\r\nstring = \"aaabbbnaaabbbnbbbz\"\r\np string.gsub(\/bbb$\/, \"morning\")\r\n=&gt; \"aaamorningn\" + \"aaamorningn\" + \"bbbz\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">\u884c\u672b\u306e\u306ebbb<\/pre>\n<p>\u5148\u982d\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f&#8221;A&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"aaabbbnaaabbb\"\r\np string.gsub(\/Aaaa\/, \"morning\")\r\n=&gt; \"morningbbbn\" + \"aaabbb\"\r\n\r\nstring = \"bbbbbnbbbbbnbbbz\"\r\np string.gsub(\/Abb\/, \"morning\")\r\n=&gt; \"morningbbbn\" + \"bbbbbn\" + \"bbbz\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">\u5148\u982d\u306eaaa<\/pre>\n<p>\u6539\u884c\u5f8c\u306eaaa\u306f\u542b\u307e\u308c\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u672b\u5c3e\u3092\u6307\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f&#8221;z&#8221;\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true \">string = \"aaabbbnaaabbb\"\r\np string.gsub(\/bbbz\/, \"morning\")\r\n=&gt; \"aaabbbn\" + \"aaamorning\"\r\n\r\nstring = \"bbbbbnbbbbbnbbb\"\r\np string.gsub(\/bbbz\/, \"morning\")\r\n=&gt; \"bbbbbn\" + \"bbbbbn\" + \"morning\"<\/pre>\n<p>\u4e00\u81f4\u3059\u308b\u6587\u5b57\u5217<\/p>\n<pre class=\"lang:ruby decode:true \">\u672b\u5c3e\u306ebbb<\/pre>\n<h2>\u6b63\u898f\u8868\u73fe\u65e9\u898b\u8868<\/h2>\n<p>\u6b63\u898f\u8868\u73fe\u306f\u666e\u6bb5\u304b\u3089\u4f7f\u3044\u6163\u308c\u3066\u3044\u306a\u3044\u3068\u3001\u4f7f\u3044\u65b9\u3092\u5fd8\u308c\u3066\u3057\u307e\u3044\u304c\u3061\u3067\u3059\u3002\u4ee5\u4e0b\u306e\u8a18\u4e8b\u3067\u306fRuby\u3067\u4f7f\u7528\u3067\u304d\u308b\u6b63\u898f\u8868\u73fe\u306e\u6587\u6cd5\u3092\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\uff01<br \/>\n            <a href=\"https:\/\/www.sejuku.net\/blog\/11690\" class=\"blog-card-anchor\">\n                <div class=\"blog-card\">\n                <div class=\"blog-card-content\">\n                    <div class=\"blog-card-thumbnail\">\n                    <img decoding=\"async\" class=\"blog-card-thumbnail-img\" src=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/10\/eyecatch_template-22-150x86.jpg\">\n                    <\/div>\n                    <div class=\"blog-card-title-wrap\">\n                    <div class=\"blog-card-title\">\u5fd8\u308c\u305f\u3089\u8aad\u307f\u305f\u3044Ruby\u6b63\u898f\u8868\u73fe\u306e\u6587\u6cd5\u65e9\u898b\u8868<\/div>\n                    <div class=\"blog-card-update-date\">\u66f4\u65b0\u65e5\uff1a2021\u5e7411\u670819\u65e5<\/div>\n                    <\/div>\n                <\/div>\n                <\/div>\n            <\/a>\n            <\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u3092\u3064\u3044\u3066\u3001<br \/>\n<div class=\"box01\"><\/p>\n<ul>\n<li><b>\u305d\u3082\u305d\u3082\u6b63\u898f\u8868\u73fe\u3068\u306f\uff1f<\/b><\/li>\n<li><b>\u6b63\u898f\u8868\u73fe\u306e\u30d1\u30bf\u30fc\u30f3\u4e00\u89a7<\/b><\/li>\n<li><b>\u6b63\u898f\u8868\u73fe\u3067\u6587\u5b57\u5217\u306a\u3069\u306e\u62bd\u51fa\u3092\u884c\u3046\u306b\u306f\uff1f<\/b><\/li>\n<li><b>\u6b63\u898f\u8868\u73fe\u3067\u7f6e\u63db\u51e6\u7406\u3092\u884c\u3046\u306b\u306f\uff1f<\/b><\/li>\n<\/ul>\n<p><\/div><br \/>\n\u306a\u3069\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002\u8aac\u660e\u3057\u305f\u4fbf\u5229\u306a\u30e1\u30bd\u30c3\u30c8\u3092\u4f7f\u3044\u3053\u306a\u305b\u3070\u3001\u7684\u78ba\u306b\u6587\u5b57\u5217\u3092\u64cd\u4f5c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u30e1\u30bf\u6587\u5b57\u5217\u3068\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3048\u3070\u601d\u3044\u901a\u308a\u306b\u6587\u5b57\u5217\u3092\u30de\u30c3\u30c1\u3055\u305b\u3089\u308c\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u6b63\u898f\u8868\u73fe\u3092\u899a\u3048\u308b\u306b\u306f\u81ea\u5206\u3067\u3055\u307e\u3056\u307e\u306a\u30d1\u30bf\u30fc\u30f3\u3092\u4f5c\u6210\u3059\u308b\u306e\u304c\u4e00\u756a\u306e\u8fd1\u9053\u306a\u306e\u3067\u3001\u72ec\u81ea\u306e\u8868\u73fe\u3092\u305f\u304f\u3055\u3093\u4f5c\u6210\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u3082\u3057\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u306b\u3064\u3044\u3066\u5fd8\u308c\u3066\u3057\u307e\u3063\u305f\u3089\u3053\u306e\u8a18\u4e8b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ruby\u30d7\u30ed\u30b0\u30e9\u30de\u30fc\u521d\u5fc3\u8005\u306b\u3068\u3063\u3066\u3001\u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u304c\u3044\u307e\u3044\u3061\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u3068\u611f\u3058\u3066\u3044\u308b\u4eba\u3082\u591a\u3044\u306e\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f \u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u304c\u3088\u304f\u308f\u304b\u3089\u306a\u3044 \u6b63\u898f\u8868\u73fe\u306e\u4f7f\u3044\u65b9\u3092\u3059\u3050\u306b\u5fd8\u308c\u3066\u3057\u307e\u3046 \u305d\u3093\u306a\u6b63\u898f\u8868\u73fe\u3092\u308f\u304b\u308a\u3084\u3059\u304f [&hellip;]<\/p>\n","protected":false},"author":16433,"featured_media":75834,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"swell_btn_cv_data":"","footnotes":""},"categories":[2351],"tags":[114,68,639],"class_list":["post-11692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ruby-start","tag-ruby","tag-68","tag-639"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0<\/title>\n<meta name=\"description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sejuku.net\/blog\/11692\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"og:description\" content=\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sejuku.net\/blog\/11692\" \/>\n<meta property=\"og:site_name\" content=\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/sejuku2013\" \/>\n<meta property=\"article:published_time\" content=\"1970-01-01T00:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-06T02:39:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/11\/ruby.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"700\" \/>\n\t<meta property=\"og:image:height\" content=\"400\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@samuraijuku\" \/>\n<meta name=\"twitter:site\" content=\"@samuraijuku\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692\"},\"author\":{\"name\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/d20c57b59dba15001519a8a671183095\"},\"headline\":\"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01\",\"datePublished\":\"1970-01-01T00:00:00+00:00\",\"dateModified\":\"2024-05-06T02:39:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692\"},\"wordCount\":190,\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/ruby.jpg\",\"keywords\":[\"ruby\",\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\",\"\u6b63\u898f\u8868\u73fe\"],\"articleSection\":[\"Ruby\u5165\u9580\"],\"inLanguage\":\"ja\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692\",\"name\":\"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/ruby.jpg\",\"datePublished\":\"1970-01-01T00:00:00+00:00\",\"dateModified\":\"2024-05-06T02:39:46+00:00\",\"description\":\"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692#primaryimage\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/ruby.jpg\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/11\\\/ruby.jpg\",\"width\":700,\"height\":400},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/11692#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"name\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0\",\"description\":\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#organization\",\"name\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/logo.png\",\"width\":600,\"height\":600,\"caption\":\"\u682a\u5f0f\u4f1a\u793eSAMURAI\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/sejuku2013\",\"https:\\\/\\\/x.com\\\/samuraijuku\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCCFOQO5aDK0xXam4cUQXT8g\\\/featured\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/#\\\/schema\\\/person\\\/d20c57b59dba15001519a8a671183095\",\"name\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g\",\"caption\":\"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\"},\"description\":\"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u587e\u306f\u300c\u4eba\u751f\u3092\u5909\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u300d\u3092\u30b3\u30f3\u30bb\u30f3\u30d7\u30c8\u306b\u3001\u904e\u53bb\u591a\u304f\u306e\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u8f29\u51fa\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3067\u3059\u3002\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\u3067\u306f\u6280\u8853\u7cfb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u4e2d\u5fc3\u306b\u6709\u7528\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u3066\u3044\u304d\u307e\u3059\u3002\",\"url\":\"https:\\\/\\\/www.sejuku.net\\\/blog\\\/author\\\/samurai-tech\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sejuku.net\/blog\/11692","og_locale":"ja_JP","og_type":"article","og_title":"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","og_description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","og_url":"https:\/\/www.sejuku.net\/blog\/11692","og_site_name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","article_publisher":"https:\/\/www.facebook.com\/sejuku2013","article_published_time":"1970-01-01T00:00:00+00:00","article_modified_time":"2024-05-06T02:39:46+00:00","og_image":[{"width":700,"height":400,"url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/11\/ruby.jpg","type":"image\/jpeg"}],"author":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","twitter_card":"summary_large_image","twitter_creator":"@samuraijuku","twitter_site":"@samuraijuku","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sejuku.net\/blog\/11692#article","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/11692"},"author":{"name":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/d20c57b59dba15001519a8a671183095"},"headline":"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01","datePublished":"1970-01-01T00:00:00+00:00","dateModified":"2024-05-06T02:39:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/11692"},"wordCount":190,"publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/11692#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/11\/ruby.jpg","keywords":["ruby","\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","\u6b63\u898f\u8868\u73fe"],"articleSection":["Ruby\u5165\u9580"],"inLanguage":"ja"},{"@type":"WebPage","@id":"https:\/\/www.sejuku.net\/blog\/11692","url":"https:\/\/www.sejuku.net\/blog\/11692","name":"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 | \u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","isPartOf":{"@id":"https:\/\/www.sejuku.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sejuku.net\/blog\/11692#primaryimage"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/11692#primaryimage"},"thumbnailUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/11\/ruby.jpg","datePublished":"1970-01-01T00:00:00+00:00","dateModified":"2024-05-06T02:39:46+00:00","description":"\u3053\u306e\u8a18\u4e8b\u3067\u306f\u300c \u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01 \u300d\u306b\u3064\u3044\u3066\u3001\u8ab0\u3067\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u89e3\u8aac\u3057\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3092\u8aad\u3081\u3070\u3001\u3042\u306a\u305f\u306e\u60a9\u307f\u304c\u89e3\u6c7a\u3059\u308b\u3060\u3051\u3058\u3083\u306a\u304f\u3001\u65b0\u305f\u306a\u6c17\u4ed8\u304d\u3082\u767a\u898b\u3067\u304d\u308b\u3053\u3068\u3067\u3057\u3087\u3046\u3002\u304a\u60a9\u307f\u306e\u65b9\u306f\u305c\u3072\u3054\u4e00\u8aad\u304f\u3060\u3055\u3044\u3002","breadcrumb":{"@id":"https:\/\/www.sejuku.net\/blog\/11692#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sejuku.net\/blog\/11692"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/11692#primaryimage","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/11\/ruby.jpg","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2016\/11\/ruby.jpg","width":700,"height":400},{"@type":"BreadcrumbList","@id":"https:\/\/www.sejuku.net\/blog\/11692#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sejuku.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u3010Ruby\u306e\u6b63\u898f\u8868\u73fe\uff01\u3011\u57fa\u790e\u306e\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u5fb9\u5e95\u89e3\u8aac\uff01"}]},{"@type":"WebSite","@id":"https:\/\/www.sejuku.net\/blog\/#website","url":"https:\/\/www.sejuku.net\/blog\/","name":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u30d6\u30ed\u30b0","description":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u306e\u3059\u3079\u3066\u304c\u30b3\u30b3\u306b\u3002","publisher":{"@id":"https:\/\/www.sejuku.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sejuku.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/www.sejuku.net\/blog\/#organization","name":"\u682a\u5f0f\u4f1a\u793eSAMURAI","url":"https:\/\/www.sejuku.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","contentUrl":"https:\/\/www.sejuku.net\/blog\/wp-content\/uploads\/2023\/07\/logo.png","width":600,"height":600,"caption":"\u682a\u5f0f\u4f1a\u793eSAMURAI"},"image":{"@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/sejuku2013","https:\/\/x.com\/samuraijuku","https:\/\/www.youtube.com\/channel\/UCCFOQO5aDK0xXam4cUQXT8g\/featured"]},{"@type":"Person","@id":"https:\/\/www.sejuku.net\/blog\/#\/schema\/person\/d20c57b59dba15001519a8a671183095","name":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d91ed20aaa7f873a0f4f35586561303460c1e3864746dddb6ebe0fb093c1952d?s=96&d=mm&r=g","caption":"\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8"},"description":"\u4f8d\u30a8\u30f3\u30b8\u30cb\u30a2\u587e\u306f\u300c\u4eba\u751f\u3092\u5909\u3048\u308b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u5b66\u7fd2\u300d\u3092\u30b3\u30f3\u30bb\u30f3\u30d7\u30c8\u306b\u3001\u904e\u53bb\u591a\u304f\u306e\u30d5\u30ea\u30fc\u30e9\u30f3\u30b9\u30a8\u30f3\u30b8\u30cb\u30a2\u3092\u8f29\u51fa\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb\u3067\u3059\u3002\u4f8d\u30c6\u30c3\u30af\u7de8\u96c6\u90e8\u3067\u306f\u6280\u8853\u7cfb\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u4e2d\u5fc3\u306b\u6709\u7528\u306a\u60c5\u5831\u3092\u767a\u4fe1\u3057\u3066\u3044\u304d\u307e\u3059\u3002","url":"https:\/\/www.sejuku.net\/blog\/author\/samurai-tech"}]}},"_links":{"self":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/11692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/users\/16433"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/comments?post=11692"}],"version-history":[{"count":0,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/posts\/11692\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media\/75834"}],"wp:attachment":[{"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/media?parent=11692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/categories?post=11692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sejuku.net\/blog\/wp-json\/wp\/v2\/tags?post=11692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}