From: Robert Klemme Date: 2010-09-16T23:36:02+09:00 Subject: Re: How the regular expression to match "//"? On Thu, Sep 16, 2010 at 4:22 PM, Brian Candler wrote: >>  if line =~ /^////.*/ > > if line =~ /^\/\// > > if line =~ %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*//} =~ line puts "This is a comment: #{line}" end Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/