in reply to regex replacement help

Using a zero width, negative look behind assertion will get you want you want. Read at perlre.
use Data::Dumper; use strict; my $str = 'AAA~BB~CCCCC~DDD~'; my @a = split /(?<=~)/, $str; print Dumper(\@a);

Replies are listed 'Best First'.
Re^2: regex replacement help
by mkenney (Beadle) on Mar 29, 2011 at 19:11 UTC
    Love how many ways you can skin a cat! Thanks for the help!!!