my $string = '\\\\domca-prn01\DH4-2139-HP4'; if ( $string =~ /\\\\.*\\.*/) { print"match\n"; }