Test, validate and match regular expressions
This regex matches both URLs and email addresses in a single pattern. It captures URLs with a protocol scheme (3-9 letters like http, https, ftp) optionally followed by //, an optional user@ prefix, and a domain, or strings starting with www. It also matches email addresses via the user@domain form. The tail portion optionally matches URL paths, query strings (?key=value), and fragments (#anchor). Useful for extracting links and emails from unstructured text.