Mega Code Archive

 
Categories / Ruby / String
 

Similar to $, the shortcut z matches the end of a string, not a line

opening = "This is a test. This is a test. \nThis is a test. This is a test. ,\n" opening.grep(/this is,\z/)