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