Aaron Aaron - 1 year ago 149
Perl Question

Split unique forward slash


Trying to split the string so that the result comes out as


Is there a way to do this with regex? I want to split when
is alone, but not split
and also remove

Answer Source
my @parts = map s|^/\@||r, split qr|(?<!\.)(?=/)|, $s;

To remove slashes as well, whether or not they're followed by an @, it's

my @parts = split qr|(?<!\.)/\@?|, $s;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download