<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sessan</author_name>
  <author_url>https://blog.hatena.ne.jp/sessan/</author_url>
  <blog_title>setoya-blog</blog_title>
  <blog_url>https://www.setoya-blog.com/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>(((あああ)))いいい(((ううう)))のような文字列で(((と)))に囲まれている部分を全部空白文字に変換したい場合、単純に次のようにやってしまうと、残って欲しい「いいい」の部分もきえてしまう。 test = &quot;(((あああ)))いいい(((ううう)))&quot; puts test.gsub(/\(\(\(.+\)\)\)/, '') 実行結果 空白になり、「いいい」が消えてしまう。これは、外側の(((と)))に「いいい」が囲まれているため。これを防ぐためには、(((と)))に囲まれている最短の中身だけをマッチングさせる必要があり、それには正規表現の?をつかう。 test = &quot;(((あああ))…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.setoya-blog.com%2Fentry%2F2013%2F09%2F23%2F205349&quot; title=&quot;正規表現で最短一致を扱う - setoya-blog&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>2013-09-23 20:53:49</published>
  <title>正規表現で最短一致を扱う</title>
  <type>rich</type>
  <url>https://www.setoya-blog.com/entry/2013/09/23/205349</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
