www.un.org/Depts/DGACM/index_spanish.htm 简短回答: 。 在字面上,它有<代码>(?)/,而就物体而言,它只是空洞。 当您填写/
和new RegExp(>
时,source
property is the same (两者都是用一个空间-character做的说明)。
。 如果你看着Qunit的消息来源,你看着这个法典的范畴:
"regexp": function (b, a) {
return QUnit.objectType(b) === "regexp" &&
a.source === b.source && // the regex itself
a.global === b.global && // and its modifers (gmi) ...
a.ignoreCase === b.ignoreCase &&
a.multiline === b.multiline;
};
你们可以看看,如何使用本法典来区分源参数(它只是将每一浮游动物的特性加以输出,并检验其平等):
function eq(x, y) {
console.log("x.source:", " " + x.source + " ", "y.source:", " " + y.source + " ", "===:", x.source === y.source);
console.log("x.global:", x.global, "y.global:", y.global, "===:", x.global === y.global);
console.log("x.ignoreCase:", x.ignoreCase, "y.ignoreCase:", y.ignoreCase, "===:", x.ignoreCase === y.ignoreCase);
console.log("x.multiline:", x.multiline, "y.multiline:", y.multiline, "===:", x.multiline === y.multiline);
}
When you call this with eq(/(?:)/, new RegExp());
, you get:
x.source: (?:) y.source: ===: false
x.global: false y.global: false ===: true
x.ignoreCase: false y.ignoreCase: false ===: true
x.multiline: false y.multiline: false ===: true
当你打电话到<条码>以下(///,新编号(“”)时,请上条码>。
x.source: y.source: ===: true
x.global: false y.global: false ===: true
x.ignoreCase: false y.ignoreCase: false ===: true
x.multiline: false y.multiline: false ===: true