http://www.perlmonks.org?node_id=1043998


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