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