使用perl中的正则表达式切割部分url

Jen*_*tin 1 regex perl

我有以下网址:

http://stagingbugzilla.cpiv.com/html/estVerificationPool/estPendingBugs.php?team_name=General%20administration

在"?"之后需要以适当的方式提取值 需要找到如何在字符串中的http://example.com部分中在perl中爆炸,并将其存储在自己的变量中,将其拆分并在传递之前保存在变量中.

pil*_*row 10

不要自己动手,使用URI模块,它旨在理解这种数据.

my $uri = URI->new('http://hostname.com/...?...');
$uri->query;  # The value after the '?'
$uri->scheme; # "http"
$uri->host;   # hostname.com
Run Code Online (Sandbox Code Playgroud)