rocketperl has asked for the wisdom of the Perl Monks concerning the following question:
Good day monkers!!
I'm trying to find consequtive, duplicating alphabets that are greater than 5 in length.
$sequ{$K} has a string of alphabets in upper case
With the regex that i used below, I expect my @match array to have all the alphabets that are duplicated more than 4 times.
However, this regex works perfectly well with some inputs, while it doesn'nt show me all the repeated letters and in some cases more number of duplicated letters than the original.
Please can someone tell me, what went wrong with this regex/ or an alternative way of finiding duplicates?
if (@match=$sequ{$k}=~m/([A-Z])\g1{5,}/g)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Backreference regex help
by Athanasius (Archbishop) on Nov 01, 2014 at 06:51 UTC | |
by rocketperl (Sexton) on Nov 01, 2014 at 07:42 UTC | |
|
Re: Backreference regex help
by Loops (Curate) on Nov 01, 2014 at 06:56 UTC |