Updated the regex to be a little more forgiving. Does not handle paths with @, like "ftp://server/@folder"