#!/usr/bin/perl use strict; my $second_str = q{591[\s-~]*G-Y[\s-~]*6}; $second_str =~ s/(\w)-(\w)/$1 $2/g; print "\nSecond Strip===========$second_str======";