Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What's wrong with /([\w-]+:\/\/[^\s]+)/gi

It's not fancy but it will essentially match any url



/./ will also match any URL. The point is to reject non-URLs.


Yes, to reject non-URLs and also some URLs that are technically valid but that I want to explicitly disallow anyway.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: