Test, validate and match regular expressions
This pattern matches URLs in text, breaking them into separate capture groups: optional protocol (http:// or https://), optional www. prefix, domain name, top-level domain extension (dot followed by characters), and optional path segment. The granular capture group structure makes it ideal for URL cleaning tasks such as normalizing links, removing protocols or www prefixes, or extracting specific URL components. Useful for link detection and processing in free-form text content.