my $name = "0010 0010 text // text // JOHN DOE"; chomp($name); $name =~ s/^(0010 ){2}(.*\/\/ ){2}(.*)$/$3/i; print $name;