Hi,
I think its an banal bug, but would be happy if someone can help me with this.. Here` s the code:
($CON,$WWW,$HOST,$SLD,$TLD,$PORT) = $conf[1] =~ m|(http(?:s?))?(?:(?:: +//)?(w{0,3})\.{0,1})?((.*)(?:\.)(.*))(?::(\d{0,10})?)|;
Following "types" of URLs must come through:
http(s)://www.example.de
http(s)://example.de
www.example.de
example.de
and if they come with a port, it must work too:
.de:443
If a URl with port is used everything works fine. Without Port nothing works
print $CON,$WWW,$HOST,$SLD,$TLD,$PORT;
Prints following:
http(s) www example.de example de 443
if something is missing: http://example.de:80 :
http "empty" example.de example de 80 ”
Somewhere must be a little bug.
No Variable gets a value if a URL with no Port is given
I guess the reason is "?::". No ":" no match. If I change it both URLs are accepted but it does not split up the Port. The port remains at the TopLevelDomain and is joined to the host variable.
In reply to Perl RegEx (url explode) by U_nix$_@
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |