Mega Code Archive

 
Categories / Ruby / Development
 

Match a regular repression in if statement

line = "abc"   if line =~ /Perl|Python/     puts "Scripting language mentioned: #{line}"   end