以下の内容はhttps://tbpgr.hatenablog.com/entry/20120530/1338391979より取得しました。


書籍 Regular Expressions Cookbook | Search Line by Line

パンくず

書籍 Regular Expressions Cookbook
Search Line by Line

概要

コマンドラインのように、各行に対して正規表現を行う方法について

サンプル

subject =<<"EOS"
one
two
three
EOS
lines = subject.split(/\r?\n/)
re = /two/
lines.each do |line|
  if line =~ re
     puts "true"
  else
     puts "false"
  end
end

出力

false
true
false



以上の内容はhttps://tbpgr.hatenablog.com/entry/20120530/1338391979より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14