2008-08-17から1日間の記事一覧

正規表現

re = Regexp.new("abc*def") # /abc*def/ re2 = Regexp.new(Regexp.quote("abc*def") # /abc\*def/ となる\s.. space \d.. これはなんの略かね? \w.. wordかな? \Aとか\Zとかもあるがこれは"^"とか"$"とかとおなじ?sub,sub!,gsub,gsub!,scanなどが基本 st…