#!/usr/bin/perl use strict; use warnings; no warnings qw /syntax/; $_ = "---abc"; print "Lookahead matches\n" if /(?=abc)\w/; print "Lookbehind matches\n" if /(?<=abc)\w/; __END__ Lookahead matches