Is this what you want?
use strict; use warnings; my $string = 'ABCDEEFGHIJJJKLMNOOOOPQRSTUVWXXYZ'; print $1, "\n" while $string =~ m/(([\w])(?=\2).(?!\2).)/g;
Prints:
EEF JJK OOP XXY
In reply to Re: Backreferences in negated character classes
by GrandFather
in thread Backreferences in negated character classes
by bobf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |