a:7:{s:9:"#provides";s:11:"dojo.regexp";s:9:"#resource";s:9:"regexp.js";s:11:"dojo.regexp";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:41:"Regular expressions and Builder resources";}s:24:"dojo.regexp.escapeString";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:3:"str";a:1:{s:4:"type";s:6:"String";}s:6:"except";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"String";s:7:"summary";s:53:"a String with special characters to be left unescaped";}}s:6:"source";s:160:" return str.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, function(ch){ if(except && except.indexOf(ch) != -1){ return ch; } return "\\" + ch; }); // String";s:7:"summary";s:67:"Adds escape sequences for special characters in regular expressions";}s:24:"dojo.regexp.buildGroupRE";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:3:"arr";a:2:{s:4:"type";s:12:"Object|Array";s:7:"summary";s:37:"A single value or an array of values.";}s:2:"re";a:2:{s:4:"type";s:8:"Function";s:7:"summary";s:72:"A function. Takes one parameter and converts it to a regular expression.";}s:10:"nonCapture";a:2:{s:8:"optional";b:1;s:4:"type";s:7:"Boolean";}}s:6:"source";s:1649:"dojo.provide("dojo.regexp"); dojo.regexp = { // summary: Regular expressions and Builder resources }; dojo.regexp.escapeString = function(/*String*/str, /*String?*/except){ // summary: // Adds escape sequences for special characters in regular expressions // except: // a String with special characters to be left unescaped return str.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, function(ch){ if(except && except.indexOf(ch) != -1){ return ch; } return "\\" + ch; }); // String } dojo.regexp.buildGroupRE = function(/*Object|Array*/arr, /*Function*/re, /*Boolean?*/nonCapture){ // summary: // Builds a regular expression that groups subexpressions // description: // A utility function used by some of the RE generators. The // subexpressions are constructed by the function, re, in the second // parameter. re builds one subexpression for each elem in the array // a, in the first parameter. Returns a string for a regular // expression that groups all the subexpressions. // arr: // A single value or an array of values. // re: // A function. Takes one parameter and converts it to a regular // expression. // nonCapture: // If true, uses non-capturing match, otherwise matches are retained // by regular expression. Defaults to false // case 1: a is a single value. if(!(arr instanceof Array)){ return re(arr); // String } // case 2: a is an array var b = []; for(var i = 0; i < arr.length; i++){ // convert each elem to a RE b.push(re(arr[i])); } // join the REs as alternatives in a RE group. return dojo.regexp.group(b.join("|"), nonCapture); // String";s:7:"summary";s:54:"Builds a regular expression that groups subexpressions";s:11:"description";s:295:"A utility function used by some of the RE generators. The subexpressions are constructed by the function, re, in the second parameter. re builds one subexpression for each elem in the array a, in the first parameter. Returns a string for a regular expression that groups all the subexpressions.";s:7:"returns";s:6:"String";}s:17:"dojo.regexp.group";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:10:"expression";a:1:{s:4:"type";s:6:"String";}s:10:"nonCapture";a:3:{s:8:"optional";b:1;s:4:"type";s:7:"Boolean";s:7:"summary";s:88:"If true, uses non-capturing match, otherwise matches are retained by regular expression.";}}s:6:"source";s:66:" return "(" + (nonCapture ? "?:":"") + expression + ")"; // String";s:7:"summary";s:30:"adds group match to expression";s:7:"returns";s:6:"String";}s:4:"dojo";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}