Help for this page

Select Code to Download


  1. or download this
    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";
    
  2. or download this
    Before : 1 2 3 10 6 7 8 11 12 13 14 15 161
    After  : 1-3 10 6-8 11-15 161