From: Tim Hunter Date: 2007-06-21T07:31:15+09:00 Subject: Re: Do You Understand Regular Expressions? growlatoe@yahoo.co.uk wrote: > irb(main):001:0> "hello".scan(/.*/) > => ["hello", ""] > > I was expecting one match, not two, because .* matches everything, > right? Can someone explain why an empty string is also matched? > Try anchoring the match: /^.*/ -- RMagick OS X Installer [http://rubyforge.org/projects/rmagick/] RMagick Hints & Tips [http://rubyforge.org/forum/forum.php?forum_id=1618] RMagick Installation FAQ [http://rmagick.rubyforge.org/install-faq.html]