my $string = 'something start: some text stop: other text here start: again something stop: may be some text here start: and finally stop: and maybe something here'; my ($lastgroup) = $string =~ /.*start: (.*?) stop:/s;