The Well-Grounded Rubyist [PDF] - Programmer Books
In this chapter, we'll explore Ruby's facilities for pattern matching and text processing, centering around the use of regular expressions. A regular expression in Ruby serves the same purposes it does in other languages: it specifies a pattern of characters, a pattern that may or may not correctly predict (that is, match) a given string. Pattern-match operations are used for conditional branching (match/no match), pinpointing substrings (parts of a string that match parts of the pattern), and various text-filtering techniques. Regular expressions in Ruby are objects. You send messages to a regular expression.
Sep-6-2019, 23:46:09 GMT
- Technology: