4 ms·
@stephenhay seems to be the winner here if you don't need IP addresses (or weird dashed URLS). It's only 38 characters long and easy to understand. @^(http
by dmix 5y ago
@stephenhay seems to be the winner here if you don't need IP addresses (or weird dashed URLS). It's only 38 characters long and easy to understand.
@^(https?|ftp)://[^\s/$.?#].[^\s]*$@iS
The simpler the better, if you're going to use something that is not ideal.
- loloquwowndueo 5y agoDoesn’t cover mailto: which is fairly common. To be pedantic/strict, mailto: are URIs not URLs.