Diego Virasoro wrote: > given an instance of String, str, how do you select/copy the section of > the string between two given strings START_STRING and END_STRING? Here's one way: STRING_BEFORE = "hello" STRING_AFTER = "goodbye" re = /#{STRING_BEFORE}(.+?)#{STRING_AFTER}/mo str = "I just wanted to say hello to you before I say goodbye for the final time." str << " Oh, hello and goodbye again." p str.scan( re ).flatten #=> [" to you before I say ", " and "]