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 .*.
In reply to Re: Matching on a string
by the pusher robot
in thread Matching on a string
by kirk123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |