in reply to Capturing text between literal string delimiters (was: Regular expressions)
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
|
|---|