in reply to Capturing text between literal string delimiters (was: Regular expressions)

I think you had better add some word boundries in there to avoid catching words that start or end with "sp".
use Data::Dumper; $string = "sp Hello there sp \n Hey hey sp How are you? sp I need a ds +p chip and have a spelling test."; @results = $string =~ m/\bsp\s+(.*?)\s+sp\b/g; print Data::Dumper->Dump([\@results]); __OUTPUT__ $VAR1 = [ 'Hello there', 'How are you?' ];

--

flounder