<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kiririmode</author_name>
  <author_url>https://blog.hatena.ne.jp/kiririmode/</author_url>
  <blog_title>理系学生日記</blog_title>
  <blog_url>https://kiririmode.hatenablog.jp/</blog_url>
  <categories>
    <anon>perl</anon>
  </categories>
  <description>特定の文字列がある行から、別の特定の文字列がある行までを抽出したいということがよくあります。 これgrep等を使うと苦労する話なんですが、flip-flop演算子を使ったPerlのone-linerで可能です。 例えば昨日の記事ではgit help commitの中から--no-edit/オプションの説明を抽出しました。 これは--no-editという文字列が出てくるところから空行までを抽出すれば良い。これは以下のようにすれば可能です。 $ git help commit | perl -nle 'print if /--no-edit/ ... /^\s*$/' 解説自体に空行が混じるケース…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkiririmode.hatenablog.jp%2Fentry%2F20210226%2F1614351599&quot; title=&quot;grepでは困難な、特定文字列の存在行から別の文字列が存在する行までの抽出  (Perlのflip-flop演算子の使い方) - 理系学生日記&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-02-26 23:59:59</published>
  <title>grepでは困難な、特定文字列の存在行から別の文字列が存在する行までの抽出  (Perlのflip-flop演算子の使い方)</title>
  <type>rich</type>
  <url>https://kiririmode.hatenablog.jp/entry/20210226/1614351599</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
