<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>thr3a</author_name>
  <author_url>https://blog.hatena.ne.jp/thr3a/</author_url>
  <blog_title>動かざることバグの如し</blog_title>
  <blog_url>https://blog.turai.work/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>やり方は以下 require 'uri' text = &lt;&lt;~EOL 夏目漱石: http://www.aozora.gr.jp/index_pages/person148.html 森鴎外: https://ja.wikipedia.org/wiki/%E6%A3%AE%E9%B4%8E%E5%A4%96 EOL URI.extract(text).uniq.each {|url| text.gsub!(url, '')} puts text なにをやっているの まずURI.extract()を使ってURLを抽出する。ここで自分でゴリゴリ正規表現書かなくていいのは楽 irb(main):01…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fblog.turai.work%2Fentry%2F20180315%2F1521079183&quot; title=&quot;Rubyで文字列からURLのみを削除する - 動かざることバグの如し&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>2018-03-15 10:59:43</published>
  <title>Rubyで文字列からURLのみを削除する</title>
  <type>rich</type>
  <url>https://blog.turai.work/entry/20180315/1521079183</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
