I’ve been looking for a simple regex for URLs, does anybody have one handy that works well? I didn’t find one with the zend framework validation classes and have seen several implementations.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I used this on a few projects, I don’t believe I’ve run into issues, but I’m sure it’s not exhaustive:
Most of the random junk at the end is to deal with situations like
http://domain.example.in a sentence (to avoid matching the trailing period). I’m sure it could be cleaned up but since it worked. I’ve more or less just copied it over from project to project.