P.S: Please don't mark this as Duplicate, I've seen many other questions.
I have a set of URLs to be validated like:
https://pqr-aaa.abc.xyz.com:8383
http://172.24.100.200:6767
and many more. I'm validating them in javascript. I've seen many questions and found the regex I'm looking for. This seems to suit my need:
^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?|^((http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$
My question is that, is there a universal standard for URL validation regex that is used by everyone, or do we just use the regex suited for our needs?