Why doesn't this do what I expected it to? I expected that it would match at the first transition between two none-alike characters -- in this case, the 'ab' pair.
($_ = 'aaab') =~ m[(.)([^\1])] and print "$1|$2"; a|a
Seems to be my day for missing the obvious?
In reply to Regex backreference problem. by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |