From: Ken Bloom Date: 2007-08-06T10:10:00+09:00 Subject: Re: Doubts on char patterns into String.each argument On Mon, 06 Aug 2007 08:43:07 +0900, Carlos Ortega wrote: > "Substring1 Substring2 Substring3".each( '\s*' ) { | substring | > puts "[" + substring +"]" > } In ruby, if you want something to be interpreted as a regular expression, you must declare it as a regular expression. Hence /\s*/ would be correct. Except that each() only accepts strings, so you can't use a regular expression with it. Use "Substring1 Substring2 Substring3".split(/\s+/).each{|x| puts x} instead -- Ken Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/