Node.js examples for Regular expression:IP Address
Is valid IP address
var isValidIP = function(str){ var reg = new RegExp(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/); if(typeof str === 'string') return reg.test(str); return reg.test(str.toString()); };