<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rubyco</author_name>
  <author_url>https://blog.hatena.ne.jp/rubyco/</author_url>
  <blog_title>rubyco（るびこ）の日記</blog_title>
  <blog_url>https://rubyco.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>正規表現の選択(|)の優先順位は低いので注意が必要です。 1. 以下のプログラムは、メールの中から「行頭にFrom:またはSubject:を含む行を抽出する」ものですが、期待はずれに終わります。 # 期待はずれ require 'pathname' Pathname.new('girl.mbox').open('r') do |f| while line = f.gets puts line if /^From|Subject:/ =~ line end end なぜなら、正規表現/^From|Subject:/では、「行頭のFrom」または「行のどこかにあるSubject:」にマッチするから…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frubyco.hatenadiary.org%2Fentry%2F20070620%2Fregex&quot; title=&quot;正規表現の選択 - rubyco（るびこ）の日記&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>2007-06-20 00:00:00</published>
  <title>正規表現の選択</title>
  <type>rich</type>
  <url>https://rubyco.hatenadiary.org/entry/20070620/regex</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
