in reply to Pattern matching: Why no \1 in [ ]?

Look at Backreferences

Also for your prolem can be solved easily without character class.

$_ = 'abcab'; if(/^(.)(?!\1)(.)(?:(?!\1|\2).)\1\2$/){ print "$&\n"; }

artist