From: Robert Klemme Date: 2007-05-04T03:30:04+09:00 Subject: Re: Regular expression - first two alphabets of a string On 03.05.2007 19:33, Abhijit Gadgil wrote: > def matchaa (str) > > if str.match(/^aa/) > return true > else > return false > end > end This does not seem to be worth a method... raise "Illegal String: #{str}" if /\Aaa/ =~ str Kind regards robert