<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ikmbear</author_name>
  <author_url>https://blog.hatena.ne.jp/ikmbear/</author_url>
  <blog_title>セットプチフォッカ</blog_title>
  <blog_url>https://ikmbear.hatenablog.com/</blog_url>
  <categories>
    <anon>PROGRAMMING</anon>
    <anon>Ruby</anon>
  </categories>
  <description>Rubyである文字列wordに数値が含まれているかどうかをBoolean値で判定するには次のようにする def self.include_number?(word) (word =~ /[0-9]/) != nil end docs.ruby-lang.org String#=~は、正規表現を引数にとり、マッチすればそのインデックスを、そうでなければnilを返す。 このメソッドでは、nilと比較することで、 見つからない場合はnil != nil はfalseを返す 見つかった場合は3 != nilのようになり、trueを返す という仕組み。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fikmbear.hatenablog.com%2Fentry%2F20211018%2F1634526176&quot; title=&quot;文字列に数値が含まれているか判定する - セットプチフォッカ&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>2021-10-18 12:02:56</published>
  <title>文字列に数値が含まれているか判定する</title>
  <type>rich</type>
  <url>https://ikmbear.hatenablog.com/entry/20211018/1634526176</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
