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.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
In reply to Re: Strange regexp behavior
by RMGir
in thread Strange regexp behavior
by wine
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |