if ($pvt_name =~m/^([a-z].*)([0-9]p.*)/) { # We capture all the data we want my ($process, $vol_temp) = ($1, $2); # now we can just do the work without worrying about using another regular expression my $process_two = substr($process, 0, 2); #got ff from ffgp my @vol_temp = split ('v',$vol_temp);