From: "David A. Black" Date: 2008-09-01T18:27:35+09:00 Subject: Re: Looking for a regular pattern Hi -- On Mon, 1 Sep 2008, Peter Hickman wrote: > Zhao Yi wrote: >> Sebastian Hungerecker wrote: >> >>> Zhao Yi wrote: >>> >>>> I think this is better [.\s] >>>> >>> No, it's not. >>> >> >> Why? It should match any character. >> > From the docs, http://www.ruby-doc.org/docs/UsersGuide/rg/regexp.html > > |\s| space character; same as |[ \t\n\r\f] > > That is not any character it is only whitespace. Yes, but [.\s] is a character class, consisting of any character other than \n, plus any space including \n. So it will match any character. 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!