#!/usr/bin/perl use warnings; use strict; my $txt = '1,2'; $txt =~ s/(\d+)\.(\d+)/$10,$2/;