ruby と 文字コード

ruby で文字コードを指定して実行。

これなら日本語での正規表現にも対応できるみたいです。

てか今まで気がつかなかったーーーー!

ruby -Ks ./goo_bar.rb

  # 年月日を適切なフォーマットに
  date.gsub!(/(\d+)年(\d+)月(\d+)日/,'\1/\2/\3')

  if title =~ /アボットチョイス/
    puts "アボットチョイスいくよ!"
  end

Tags: ,

This entry was posted on 火曜日, 12月 16th, 2008 at 5:29 PM and is filed under 日記. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply