Help for this page
my $str="1 2 3 10 6 7 8 11 12 13 14 15 161"; ... $str=~s/$rex/$1-$2/g; # and now substitute in print "After : $str\n";
Before : 1 2 3 10 6 7 8 11 12 13 14 15 161 After : 1-3 10 6-8 11-15 161