Mega Code Archive

 
Categories / Ruby / String
 

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/)