Test, validate and match regular expressions
This regex attempts to match URLs in text, including both domain-based URLs and IP-address-based URLs. It looks for patterns containing protocol (http/https), domain names, TLDs, paths, and query parameters. It also separately matches URLs that start with just the protocol prefix. Due to its complex structure with alternation, it may not reliably capture all valid URLs and might match some invalid ones.