On Thu, Sep 16, 2010 at 4:22 PM, Brian Candler <b.candler / pobox.com> wrote:
>> =A0if line =3D~ /^////.*/
>
> if line =3D~ /^\/\//
>
> if line =3D~ %r{^//}
>
> (note that the .* does nothing in your original regexp, i.e. it can be
> removed without changing the behaviour)

For comment lines it's probably better to allow for some indentation:

if %r{^\s*//} =3D~ line
  puts "This is a comment: #{line}"
end

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/