Tag: https

Regular expression for matching URL

For a piece of software I wrote, I needed a security check which validates URLs. It needed to match any URL starting with HTTP or HTTPS, the host could be a IP or a hostname (like localhost) and it also should match port numbers (like :8080 for example) and trailing directories (/directory/anotherdirectory). Basically, it should …

Continue reading