example: $ perl -e '$s="pilpoil";if ($s=~/p(.)lp(.)il/) { print "h".$1."h".$2;}' hiho