Test, validate and match regular expressions
This regex matches the protocol (HTTP or HTTPS, if present) and the domain name from the beginning of a string or line. It captures everything up to the first forward slash, effectively isolating the base URL from its path and query parameters. It is commonly used in multiline documents to clean up URLs or extract just the origin domains for analysis.