Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/362.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 这个正则表达式在jQueryV1.11.0中用于什么?_Javascript_Jquery_Function - Fatal编程技术网

Javascript 这个正则表达式在jQueryV1.11.0中用于什么?

Javascript 这个正则表达式在jQueryV1.11.0中用于什么?,javascript,jquery,function,Javascript,Jquery,Function,有人知道这个正则表达式的用途吗?它是jqueryv1.11.0的第26行 o = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g 它在这里被称为函数 if (parseInt(str.slice(-(--([,,,undefined].join()).length))[0]) * parseInt(str.slice(0 - - - 1 - - - - - 1 - - - - 0)[1]) * stmnt.split("All").length == ts.slice

有人知道这个正则表达式的用途吗?它是jqueryv1.11.0的第26行

o = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g
它在这里被称为函数

if (parseInt(str.slice(-(--([,,,undefined].join()).length))[0]) * parseInt(str.slice(0 - - - 1 - - - - - 1 - - - - 0)[1]) * stmnt.split("All").length == ts.slice(ƒ(""+''+""+ƒ(1<0)+""+"-"+''+""+ƒ(0<1)+"-"+ƒ(1>0)))) {
        $.ajax("./test/" + $("#str").data('token') + "/" + str + "?ts=" + ts, {
            success: function (o) {                 
                0===str.lastIndexOf(multi.toString().substr(1,4)+stmnt.substring(2,9),0)&&(window.location.href=o);
            },
            error: function (o) {
                $(".status_ls5").html(o.responseText);
            }
        });
if(parseInt(str.slice(-([,,未定义).join()).length))[0])*parseInt(str.slice(0----1----1----0)[1])*stmnt.split(“All”).length==ts.slice(ƒ(“+”+”+“+ƒ(1)这是一个字符串

您可以将其用作。例如,您可以使用它来匹配字符串中的模式,然后,如果您愿意,将其替换为另一个字符串。

如果您选中了(而不是像您那样的缩小版本),您将有机会看到此行的相应注释:

// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,

是polyfill String.prototype.trim()方法的一部分

\s任何空白字符(空格、制表符、表单提要等)。请阅读第157页

\uFEFF-UTF-8字节顺序标记(BOM)。阅读更多信息


\xA0-拉丁文中的不间断空格(ISO 8859-1)。请阅读更多内容。

这是一个正则表达式。@Luxelin:不是一个“表达式”well@zerkms表达式…你明白了你的“这里它被称为函数”很混乱。这段代码与jquery的代码有什么关系?它在哪里被称为函数在我看来,上面示例中的
o
与下面示例中的
o
是不同的。变量名可以在不同的变量范围内重复使用而不会产生冲突。在一个范围内查看局部变量并假设变量名代表所有变量中的相同数据是行不通的可移动范围。
  if (!String.prototype.trim) {
  (function() {
    // Make sure we trim BOM and NBSP
    var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
    String.prototype.trim = function() {
      return this.replace(rtrim, '');
    };
  })();
}