Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Regex help

by Monk::Thomas (Monk)
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 studying the Monastery: (7)
As of 2015-07-30 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls