in reply to Look ahead & Look behind

If you follow the link to perlretut from perlre:SEE-ALSO, there are examples in Looking ahead and looking behind