use Regexp::Common; $_ = 'abcdegedfc'; while (/($RE{lingua}{palindrome})/g) { print "Got $1\n"; } __END__ Got a Got b Got c Got d Got e Got g Got e Got d Got f Got c