You don't need to use regexes for this. In pseudocode:
use List::MoreUtils qw{uniq} while (<FH>){ chomp; convert each line to an array of numbers splitting by "-" sort the resulting list of numbers and apply uniq to this list: my @list_of_unique_items = uniq @list; join or print again each element followed by a "-" chomp again if needed to delete the last "-" undef the array process the next line
In reply to Re: How can I reduce this with a REGEX?
by pvaldes
in thread How can I reduce this with a REGEX?
by misterperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |