in reply to Elegant way to split into sequences of identical chars?
use strict; use warnings; use Data::Dumper; my @repeats; while ( 'xx556xx' =~ m/((.)(\2)*)/g ) { push @repeats, $1; } print Dumper(\@repeats);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Elegant way to split into sequences of identical chars?
by eric256 (Parson) on Nov 30, 2005 at 16:25 UTC |