zoukankan      html  css  js  c++  java
  • Js URl检测方法(javascript)

    //URl检测方法********************************************************
    _CheckObjFunc.IsURL= function (str_url){
        var strRegex = "^((https|http|ftp|rtsp|mms)?://)"
        + "?(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?" //ftp的user@
              + "(([0-9]{1,3}\.){3}[0-9]{1,3}" // IP形式的URL- 199.194.52.184
              + "|" // 允许IP和DOMAIN(域名)
              + "([0-9a-z_!~*'()-]+\.)*" // 域名 http://www.my400800.cn
              + "([0-9a-z][0-9a-z-]{0,61})?[0-9a-z]\." // 二级域名
              + "[a-z]{2,6})" // first level domain- .com or .museum
              + "(:[0-9]{1,4})?" // 端口- :80
              + "((/?)|" // a slash isn't required if there is no file name
              + "(/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+/?)$";
              var re=new RegExp(strRegex);
              if (re.test(str_url)){
                  return (true);
              }else{
                  return (false);
              }
          }

  • 相关阅读:
    远程连接redis服务
    redis的安装以及启动
    Easyui学习之右键菜单easyui-menu
    富文本编辑器KindEditor的使用
    zookeeper启动失败解决方法
    在TortoiseSVN使用clean up
    kettle性能优化
    idea快捷键
    Spring Cloud服务网关 Zuul Filter使用
    添加路由
  • 原文地址:https://www.cnblogs.com/jishu/p/1940068.html
Copyright © 2011-2022 走看看