$data = 'foo and bar and baz went to the sea.'; @pairs = $data =~ /(and)(?=\W*(\w+))/g; print "@pairs";