in reply to Matching on a string
The following works for me:
my $string = '\\\\domca-prn01\DH4-2139-HP4'; if ( $string =~ /\\\\.*\\.*/) { print"match\n"; }
Note that I had to double the backslashes in the string, because the first one was escaping the second. You also probably want to use a character class (e.g., [\w-]+) or at least [^\\]+ instead of .*.
|
|---|