From: Imelody __ Date: 2010-09-16T23:20:19+09:00 Subject: How the regular expression to match "//"? In C/C++ language, can use "//" to comment,such as "//i++ " I want use ruby to distinguish the comment lines and code lines. but fail. : ( f.each do|line| puts line if line =~ /^////.*/ puts "The line contain //." end end Error: Unexpected tSTRING_BEG -- Posted via http://www.ruby-forum.com/.