in reply to Simple regex question
Ok, I'm cheating but what the heck ...
use Data::Dumper qw/Dumper/; $_ = "aaaabbbcccccdd eeef"; print Dumper([ keys %{{ split /(?<=(.))(?!\1)/x }} ]); __END__ $VAR1 = [ 'ccccc', 'eee', 'aaaa', ' ', 'bbb', 'dd', 'f' ];
Any comments ?
|
|---|