($_ = 'aaab') =~ m[(.)((??{"[^$1]"}))] and print "$1|$2"; a|b [download]
Abigail
In reply to Re: Regex backreference problem. by Abigail-II in thread Regex backreference problem. by BrowserUk