Реклама

Ruby – Regular expressions

Let’s put together a more interesting program. This time we test whether a string fits a description, encoded into a concise pattern. There are some characters and character combinations that have special meaning in these patterns, including: [] – range specificication (e.g., [a-z] means a letter in the range a to z) \w – letter or…