November 2008
Beginner
448 pages
12h 25m
English
The simplest regular expressions are simply literal strings. There are plenty of times when it’s enough to search against a fixed search pattern. For example, you might test for the presence of the string “Ruby”:
sentence = "Ruby is the best Ruby-like programming language." sentence =~ /Ruby/ # => 2 - There are two instances of "Ruby".
Read now
Unlock full access