Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created July 2, 2020 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miguelmota/3e719b8fd3954b71e37e99a4408ea807 to your computer and use it in GitHub Desktop.
Save miguelmota/3e719b8fd3954b71e37e99a4408ea807 to your computer and use it in GitHub Desktop.
JavaScript valid host (hostname + port) regex
/^([a-zA-Z0-9-_.]){1,253}(:[0-9]+)?$/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment