in reply to use of built-in function in regex...
perl -le '$string = "isasdffdsakk"; if($string =~ /((.+?)(??{quotemeta reverse $2}))/s){ print $1; } ' asdffdsa [download]