Skip to content

Instantly share code, notes, and snippets.

@Underdoge
Created March 3, 2017 08:44
Show Gist options
  • Save Underdoge/2d3cf6050235aa2c0a1d7eff5f7bcb98 to your computer and use it in GitHub Desktop.
Save Underdoge/2d3cf6050235aa2c0a1d7eff5f7bcb98 to your computer and use it in GitHub Desktop.
isIPv4Address
function isIPv4Address(inputString) {
return /^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/.test(inputString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment