Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 meditating upon the Monastery: (5)
As of 2014-07-10 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (202 votes), past polls