a pair of square brackets ([]) matches any character in the brackets : grep « String « Ruby
- Ruby
- String
- grep
a pair of square brackets ([]) matches any character in the brackets
opening = "this is a test\nthis is a test,\n"
opening.grep(/t[hi]s/)
Related examples in the same category