Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

(jeffa) Re: Regex Bug?

by jeffa (Bishop)
on May 26, 2002 at 07:27 UTC ( #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? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2022-11-30 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?