Skip to content

Instantly share code, notes, and snippets.

@danielestevez
Last active June 14, 2021 18:07
Show Gist options
  • Save danielestevez/e1a06600ed33eca50ae12d39bb53e7e2 to your computer and use it in GitHub Desktop.
Save danielestevez/e1a06600ed33eca50ae12d39bb53e7e2 to your computer and use it in GitHub Desktop.
Regular expressions for many things

Use https://regexr.com/

  • Extract IP/Domain from a URL (group[2])
^(http|https)://([^/]*)/?
  • Parse IP
(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment