Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
サーバー名が次のいずれかの形式のときに、UNC パスからサーバー名を取得する方法を Perl で探しています。
$unc = '//server.domain.com/share';
$unc = '\\\\server.domain.com\\share';
for my $unc ('//server.domain.com/share', '\\\\server.domain.com\\share') { my ($server) = $unc =~ m{([^/\\]+)}; print $server, "\n"; }
出力
server.domain.com server.domain.com