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