<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mtoyoshi</author_name>
  <author_url>https://blog.hatena.ne.jp/mtoyoshi/</author_url>
  <blog_title>mtoyoshi開発メモ</blog_title>
  <blog_url>https://mtoyoshi.hateblo.jp/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>ポイントは正規表現パターンの()でくくったところが、$1という変数で取得できるというところ。 当然()を複数用意すれば$2,$3という変数でマッチング箇所が抽出されます。以下はhtmlファイル中の&lt;input type=&quot;text&quot; value=&quot;&quot; class=&quot;sample&quot;&gt;みたいなtextフィールドのvalue部分を抽出して画面に表示するプログラムです。 File.foreach(&quot;F:/Temp/sample.html&quot;, &quot;r&quot;) do |line| puts $1 if line =~ /input type=&quot;text&quot; value=&quot;(.*)&quot;/i end ()でくくったとこ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmtoyoshi.hateblo.jp%2Fentry%2F20080630%2F1214799652&quot; title=&quot;ファイル中から必要箇所を抽出する - mtoyoshi開発メモ&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>2008-06-30 13:20:52</published>
  <title>ファイル中から必要箇所を抽出する</title>
  <type>rich</type>
  <url>https://mtoyoshi.hateblo.jp/entry/20080630/1214799652</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
