Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Regex help

by Monk::Thomas (Beadle)
on Jul 12, 2013 at 15:10 UTC ( #1043998=note: print w/ replies, xml ) Need Help??


in reply to Regex help

Disclaimer: I don't recommend manual URL parsing at all, since URLs can get quite hairy.

Don't use a regexp at all? 'split' may or may not be more appropriate. It depends on how you want to process the URL parts later on.

my @url = split / \/+ /xms, $url;
$url[0] = http:
$url[1] = www.chi.com
$url[2] = business


Comment on Re: Regex help
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-12-19 13:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (83 votes), past polls