From: Diego Virasoro Date: 2006-10-20T02:50:06+09:00 Subject: Re: newbie: Strings and RegExp > 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 "] Perfect, it works. Thanks a lot, and to Robert and Louis too, thanks. So basically I gather the main problem was using the /mo. Right? That alone, with the simpler regular expression seems to do the job. (maybe before it was running out of memory? is that what bus error means?) However here you are using /mo instead of /m. What does the extra o mean? And where can I read more about this topic? I've checked on the Pragmatic Programmer book (the one online) but I can't find any info on that. Thanks again. Diego