Another way.
$ perl -Mstrict -Mwarnings -E ' say join q{-}, do { my %seen; grep { not $seen{ $_ } ++ } split m{-}; } for qw{ 12-12 12-12-12 12-13-12-13 12-12-13-13 12-13-13-14 };' 12 12 12-13 12-13 12-13-14 $
I hope this is helpful.
Cheers,
JohnGG
In reply to Re: How can I reduce this with a REGEX?
by johngg
in thread How can I reduce this with a REGEX?
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |