Test, validate and match regular expressions
This PCRE2 regex matches URLs with http, https, ftp, or file protocols in text. It validates the protocol prefix followed by '://' and allowed URL characters including letters, numbers, and special characters like @, #, %, etc. The pattern prevents URLs from ending with certain punctuation marks. With the global flag, it can find all URLs within a larger string.