2010-07-10から1日間の記事一覧
Here is a sample code for multiline regular expression in Ruby 1.9. #!/usr/bin/ruby1.9 s = [0x01, 0x02, 0x03, 0x04, 0x0a, 0x0b, 0x0c].pack("C*") if s =~ %r!.{6}! puts 'match1' end if s =~ %r!.{6}!m puts 'match2' end Result: % ./multiline.r…