Skip to content

Instantly share code, notes, and snippets.

@abhisheksliam
Created March 8, 2022 09:51
Show Gist options
  • Save abhisheksliam/accd9fcc73f8bb32a529d1e71247aedb to your computer and use it in GitHub Desktop.
Save abhisheksliam/accd9fcc73f8bb32a529d1e71247aedb to your computer and use it in GitHub Desktop.
url-ip-regex
^(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])(:[0-9]{1,5})?(\/.*)?$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment