<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sugyan</author_name>
  <author_url>https://blog.hatena.ne.jp/sugyan/</author_url>
  <blog_title>すぎゃーんメモ</blog_title>
  <blog_url>https://memo.sugyan.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>自分の手元の環境でこんなことが起きた。 $ ruby -v ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21] $ irb irb(main):001:0&gt; &quot;\x01\x80\x00\x00&quot;.index(&quot;\x01&quot;) =&gt; 0 irb(main):002:0&gt; &quot;\x01\x80\x00\x00&quot;.rindex(&quot;\x01&quot;) =&gt; 1 \x01 は 0 番目にしかないのだから、 .index でも .rindex でも 0 が返ってくるはずではないの？？ 先に結論 きっかけ String#rindex の謎挙動…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmemo.sugyan.com%2Fentry%2F2022%2F12%2F22%2F182042&quot; title=&quot;Rubyでバイナリデータに対するrindex検索の挙動でハマったので調べたことメモ - すぎゃーんメモ&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>2022-12-22 18:20:42</published>
  <title>Rubyでバイナリデータに対するrindex検索の挙動でハマったので調べたことメモ</title>
  <type>rich</type>
  <url>https://memo.sugyan.com/entry/2022/12/22/182042</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
