var XRegExp;if(XRegExp)throw Error("can't load XRegExp twice in the same frame"); (function(j){var m,i,n,t,u;function k(a,b){if(!XRegExp.isRegExp(a))throw TypeError("type RegExp expected");var c=a._xregexp,a=XRegExp(a.source,v(a)+(b||""));c&&(a._xregexp={source:c.source,captureNames:c.captureNames?c.captureNames.slice(0):null});return a}function v(a){return(a.global?"g":"")+(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":"")}function z(a,b,c,e){var d=p.length,g,f,h;q=!0;try{for(;d--;)if(h=p[d],c&h.scope&&(!h.trigger||h.trigger.call(e)))if(h.pattern.lastIndex= b,(f=h.pattern.exec(a))&&f.index===b){g={output:h.handler.call(e,f,c),match:f};break}}catch(l){throw l;}finally{q=!1}return g}function r(a,b,c){if(Array.prototype.indexOf)return a.indexOf(b,c);for(c=c||0;cb.index&&this.lastIndex--}this.global||(this.lastIndex=e);return b};RegExp.prototype.test= function(a){var b;this.global||(b=this.lastIndex);(a=m.call(this,a))&&!x&&this.global&&!a[0].length&&this.lastIndex>a.index&&this.lastIndex--;this.global||(this.lastIndex=b);return!!a};String.prototype.match=function(a){XRegExp.isRegExp(a)||(a=RegExp(a));if(a.global){var b=t.apply(this,arguments);a.lastIndex=0;return b}return a.exec(this)};String.prototype.replace=function(a,b){var c=XRegExp.isRegExp(a),e,d,g;if(c){if(a._xregexp&&(e=a._xregexp.captureNames),!a.global)g=a.lastIndex}else a+="";d="[object Function]"=== Object.prototype.toString.call(b)?i.call(this+"",a,function(){if(e){arguments[0]=new String(arguments[0]);for(var f=0;fa.length-3;)d=String.prototype.slice.call(c,-1)+d,c=Math.floor(c/10);return(c?a[c]||"":"$")+d}else{c=+d;if(c<=a.length-3)return a[c];c=e?r(e,d):-1;return-1+b)b=Infinity;else if(b=Math.floor(+b),!b)return[];for(a=XRegExp.copyAsGlobal(a);(g= a.exec(c))&&!(a.lastIndex>d&&(e.push(c.slice(d,g.index)),1=b));)a.lastIndex===g.index&&a.lastIndex++;d===c.length?(!n.call(a,"")||f)&&e.push(""):e.push(c.slice(d));return e.length>b?e.slice(0,b):e};XRegExp.addToken(/\(\?#[^)]*\)/,function(a){return n.call(w,a.input.slice(a.index+a[0].length))?"":"(?:)"});XRegExp.addToken(/\((?!\?)/,function(){this.captureNames.push(null);return"("});XRegExp.addToken(/\(\?<([$\w]+)>/, function(a){this.captureNames.push(a[1]);this.hasNamedCapture=!0;return"("});XRegExp.addToken(/\\k<([\w$]+)>/,function(a){var b=r(this.captureNames,a[1]);return-1