while (<>) { s/(\.rs)\:([0-9]+)\:([0-9]+)/$1($2,$3)/; s/(\.rs)\:([0-9]+)/$1($2)/; print; }