Ruby/String/matching operator
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
if a string contains any vowels:
puts "String has vowels" if "This is a test" =~ /[aeiou]/
=~ is a matching operator
puts "String contains no digits" unless "This is a test" =~ /[0?]/