<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>K_Koh</author_name>
  <author_url>https://blog.hatena.ne.jp/K_Koh/</author_url>
  <blog_title>Just do IT</blog_title>
  <blog_url>https://k-koh.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby基礎100本ノック</anon>
  </categories>
  <description>お題 「正規表現は難しい！なんて難しいんだ！」という文字列を、gsubメソッドを使って「正規表現は簡単だ！なんて簡単なんだ！」という文字列に直せ。 引用：「たのしいRuby 第6版」P.364より 回答 str = &quot;正規表現は難しい！なんて難しいんだ！&quot; str.gsub(/正規表現/) do |m| p &quot;#{m}は簡単だ！なんて簡単なんだ&quot; end 説明 お題の意味がよくわからず、gsubメソッドにブロックを渡して処理をした。ただこれだとかなり簡単な問題になってしまう。 学び gsubメソッドを続けるという方法もあった。 str = &quot;正規表現は難しい！なんて難しいんだ！&quot; str.gs…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fk-koh.hatenablog.com%2Fentry%2F2019%2F12%2F19%2F132355&quot; title=&quot;Ruby基礎問題100本ノック#20 gsubメソッドを使う - Just do IT&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-12-19 13:23:55</published>
  <title>Ruby基礎問題100本ノック#20 gsubメソッドを使う</title>
  <type>rich</type>
  <url>https://k-koh.hatenablog.com/entry/2019/12/19/132355</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
