in reply to Strange regexp behavior

The problem is that [^\1] doesn't mean what you think it does.

perl -ne's/(.)([^\1]*)/print "$1-$2\n"/eg;' A234 A-234 AA A-A A-\ A--\ A-1 A--1 A-A A--A A1 A-1
See, the 2nd paren will match whatever it wants to. I'm not sure WHAT [^\1] means; it might be "anything but chr(1)", but I'm not sure.
--
Mike