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


in reply to Perl RegEx (url explode)

I noticed just one problem: the placement of the final question mark. The whole port part is optional, together with the colon:
m% (http(?:s?))? # http (?:(?:://)? (w{0,3})\.{0,1})? # www ((.*)(?:\.)([^:]*)) # domains (?::(\d+))? %x; # port
Edit: . changed to [^:] in # domains.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ