in reply to Pattern matching: Why no \1 in [ ]?
Also for your prolem can be solved easily without character class.
$_ = 'abcab'; if(/^(.)(?!\1)(.)(?:(?!\1|\2).)\1\2$/){ print "$&\n"; } [download]
artist