[ale] Extraction of address and pages

Keith R. Watson keith.watson at gtri.gatech.edu
Thu Nov 4 15:01:34 EST 2004


At 14:49 11/4/2004 -0500, you wrote:
>I'm trying to get http://addr:port/page
>
>from:
>
>GET http://www.google.com/ HTTP/1.1
>
>this sucks as it is too greedy.  Anyone have a suggestion.
>$m =~ m/http:\/\/(.+)\/\s+/;
>
>Thanks,
>Chris


Chris,

$m =~ m/http:\/\/(.+?)\/\s+/;

. means any character
+ means one or more times

this causes it to match to the next new line as the match is greedy by default

the ? tells it to not be greedy

keith

-------------

Keith R. Watson                        GTRI/ISD
Systems Support Specialist III         Georgia Tech Research Institute
keith.watson at gtri.gatech.edu           Atlanta, GA  30332-0816
404-894-0836



More information about the Ale mailing list