in reply to Regex (lookahead) Confusion

does this do what you want to?
my $string = "smasm"; if ( $string =~ /(.).*\1$/ ) { print "$1" ; #match a double char }