Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

(jeffa) Re: Regex Bug?

by jeffa (Bishop)
on May 26, 2002 at 07:27 UTC ( [id://169346]=note: print w/replies, xml ) Need Help??


in reply to Regex Bug?

Your question has been answered, but consider this instead:
$url =~ s/\?.*$//;
Instead of trying to capture everything UP to the question mark, just get rid of the question mark and everything AFTER it.

Also, consider the URI CPAN module:

use URI; my $uri = URI->new($url); print $uri->scheme, '://', $uri->host, $uri->path, "\n";
TIMTOWTDI! ;)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://169346]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2024-03-29 00:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found