From: "David A. Black" Date: 2008-09-01T19:28:11+09:00 Subject: Re: Looking for a regular pattern Hi -- On Mon, 1 Sep 2008, Patrick He wrote: > Additionally, you can use pattern "(.|\n)" if you want to match all > characters including "\n" in single line mode. Ruby regexes don't really have a single vs. multiple line mode distinction. They always act as if they have the Perl /m modifier in place, so that ^ and $ match beginning and end of line but never beginning and end of string. So Ruby's default mode is like Perl's multi-line mode. Ruby doesn't really have a single-line mode. /m just adds \n to the . class, so it's sort of single line, but ^ and $ still match lines and not the whole string. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates!