From: Diego Virasoro Date: 2006-10-20T01:00:15+09:00 Subject: newbie: Strings and RegExp Hello, 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? I used something like: re = /#{STRING_BEFORE}(regular_expression)#{STRING_AFTER}/ str =~ re middle = $1 where regular_expression is supposed to be a regular expression selecting any character (digits, space, newline, character, anything...). Is this the right method? And what should I use for regular_expression? I tried (.|\n)* but I get a "BUS error". Any other way? Or maybe is there a method which does what I need? (Note: I am using Ruby 1.6.4 on Solaris) Thank you Diego