Gotcha: Ruby and Perl conflicting regexp flags
Both Ruby and Perl have /m and /s regexp flags, but they are different in each language.
- To have the dot match newlines you use /s in Perl, but /m in Ruby.
- To enable multiline mode, that is ^ matches beginning of line, you use /m in Perl and nothing in Ruby. In Ruby that's the only existing mode, you can't switch it off, ^ asserts beginning of line always. Beginning of string is \A and end of string \z or \Z as in Perl.
- If that was not confusing enough, Ruby has a /s flag which means the regexp is in SJIS encoding.