replace url_regex with simpler version and parse URLs with urlparse -> this avoid infinite loops on bad URLs (backref problem)