Verify IP
function IsIP (ipstr) {var reg =/^ (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) \. ( \D{1,2}|1\D\D|2[0-4]\D|25[0-5]) \. (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) \. (\d{1,2}|1\d\d|2[0-4]\d|25[0-5]) $/g;return Ipstr.match (reg);}
The regular verification of this URL is comprehensive, it verifies that the situation includes IP, domain name, FTP, level two domain name, the domain name of the file, domain name plus port! User name, etc. information
function Isurl (str_url) {var Strregex = ' ^ ((https|http|ftp|rtsp|mms)?:/ /) ' + '? ([0-9a-z_!~* (). &=+$%-]+:)? [0-9a-z_!~* (). &=+$%-] [email protected])? ' FTP [email protected]+ ' ([0-9]{1,3}.) {3} [0-9] {1,3} '//IP url-199.194.52.184+ ' | '//Allow IP and domain (domain name) + ' ([0-9a-z_!~* ()-]+.) * '//Domain name-www.+ ' ([0-9a-z][0-9a-z-]{0,61})? [0-9a-z]. ' Two-level domain name + ' [a-z]{2,6} '//First domain-. com or. museum+ ' (: [0-9]{1,4})? '//Port-: 80+ ' ((/?) | '//a slash ' t requ Ired If there is no file Name+ ' (/[0-9a-z_!~* ().;?: @&=+$,%#-]+) +/?) $ '; var re=new RegExp (Strregex); if (Re.test (Str_url)) {return (true);} Else{return (FALSE);}}
JavaScript Regular Expression Validation Ip,url