in reply to Finding / Replacing repetetive characters from a string in a Regular expression.

It looks to me like your expression is the equivilent of :

my @numbers = $aKnosId =~ m/([a-z]{2,})/g

Update I was totally wrong... sorry. Try this:

my @numbers = $aKnosId =~ m/(([a-z])(?:(?=\2)[a-z])+)/g

But then again Roy's answer is better.

May the Force be with you

Replies are listed 'Best First'.
Re^2: Finding / Replacing repetetive characters from a string in a Regular expression.
by Roy Johnson (Monsignor) on Oct 14, 2004 at 13:33 UTC
    The difference is that your expression will match two (or more) different characters, while the OP wants to match two (or more) of the same. This should do it.
    my @numbers = $aKnosId =~ /(([a-z])\2+)/g;
    Except that both captures get returned. So to fix:
    my @numbers = grep {length > 1} $aKnosId =~ /(([a-z])\2+)/g;

    Caution: Contents may have been coded under pressure.
      Thank you! Your solution works great :D.