$url=~ m|^(\w+):/*((.*\@)?[^/]+)/(.*)$|; $protocol= uc($1); $site= $2; $path= $4;
That would accept everything up till the last '@' as part of the site regardless of any '/' characters that it might contain.
UPDATE: Corrected the '@' that needed escapedIn reply to Re: replacing text file separators in regex
by ehdonhon
in thread replacing text file separators in regex
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |