Test, validate and match regular expressions
This regular expression is designed to parse and extract specific components from a URL or network address. It captures the protocol (like HTTP or FTP), an optional username, the domain name (broken down into optional third-level, second-level, and top-level domains), and an optional port number. This regex is highly useful for tasks that require detailed analysis of web addresses, such as data extraction, log parsing, or URL validation.