skyrocker
skyrocker

Reputation: 199

how do I read a regex separated by a new line

How do I read a URL which is split over two lines using regex in Perl?

[REQ-URL]: http://hostname:8080/guiderest?
customerId=cisco&code=news&guide=MostPopular&attrFilter=BlogFlag:true&v=1

Upvotes: 0

Views: 82

Answers (1)

mpapec
mpapec

Reputation: 50637

my ($url) = $text =~ /( http [\S\r\n]+ )/x;
$url =~ tr|\r\n||d;

Upvotes: 1

Related Questions