match alternate forms of a pattern using the pipe character (|) : grep « String « Ruby
- Ruby
- String
- grep
match alternate forms of a pattern using the pipe character (|)
opening = "this is a test \nthis is a test ,\n"
puts opening.grep(/th|te/)
Related examples in the same category