@class Kind

@param {String} name
@param {String} regex
548432
function Kind(name, regex) {

    if (!Kind.checkRegExp(regex)) {
        throw new TypeError(f('Invalid %j type regexp %j', name, regex));
    }

    /**
     * @public
     * @memberOf {Kind}
     * @property
     * @type {String}
     * */
    this.name = name;

    /**
     * @public
     * @memberOf {Kind}
     * @property
     * @type {String}
     * */
    this.regex = regex;

    /**
     * @public
     * @memberOf {Kind}
     * @property
     * @type {RegExp}
     * */
    this._compiledRegExp = new RegExp(f('^(?:%s)$', this.regex));
}
782822
function Loader(regex) {
    this.cache = Object.create(null);
    this.map = Object.create(null);
    this.requests = 0;
    this.regex = regex;
  }
760781
function(e, regex) {
    var endOfSearchMarkerNode = this._getNextNode(e, true);
    var next = this._getNextNode(e);
    while (next && next != endOfSearchMarkerNode) {
      if (regex.test(next.className + " " + next.id)) {
        next = this._removeAndGetNext(next);
      } else {
        next = this._getNextNode(next);
      }
    }
  }
721958
function(name) {
    var regexp, idx,
      length = this.extraHeaders.length;

    if (this.headers[Utils.headerize(name)]) {
      return true;
    } else {
      regexp = new RegExp('^\\s*'+ name +'\\s*:','i');
      for (idx=0; idx<length; idx++) {
        if (regexp.test(this.extraHeaders[idx])) {
          return true;
        }
      }
    }

    return false;
  }
1263525
def allowPatternsForNameChecking(self, patternsFunc, patternsClass):
        
        cfgParser = self.linter.cfgfile_parser
        nameChecker = self.getCheckerByName(NameChecker)
        if not nameChecker:
            return
        if patternsFunc:
            regexFuncAdd = "|((%s).+)$" % "|".join(patternsFunc)
        else:
            regexFuncAdd = ""
        if patternsClass:
            regexClassAdd = "|((%s).+)$" % "|".join(patternsClass)
        else:
            regexClassAdd = ""
        # Modify regex for function, method and class name.
        regexMethod = cfgParser.get("BASIC", "method-rgx") + regexFuncAdd
        regexFunction = cfgParser.get("BASIC", "function-rgx") + regexFuncAdd
        regexClass = cfgParser.get("BASIC", "class-rgx") + regexClassAdd
        # Save to config parser.
        cfgParser.set("BASIC", "method-rgx", regexMethod)
        cfgParser.set("BASIC", "function-rgx", regexFunction)
        cfgParser.set("BASIC", "class-rgx", regexClass)
        # Save to name checker.
        nameChecker.config.method_rgx = re.compile(regexMethod)
        nameChecker.config.function_rgx = re.compile(regexFunction)
        nameChecker.config.class_rgx = re.compile(regexClass)
181557
function isRegExp(value) {
      var type = typeof value;
      return value && (type == 'function' || type == 'object') &&
        toString.call(value) == regexpClass || false;
    }
364526
function _stringContext(that, searchString, NAME) {
	  if (_isRegexp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
	  return String(_defined(that));
	}
393352
function (name, pattern) {

            var regex,
                ret;

            pattern = pattern || ".*";

            regex = new RegExp(pattern);

            logger.debug("PluginMatcher matchPattern testing [" + name + "] against regex [" + pattern + "]");

            ret = regex.exec(name);

            return ret !== null;

        }
676747
function _buildRegexFromString(regex) {

        if (!regex || (typeof regex !== "string" && !(regex instanceof RegExp))) {
            _regexDebug();
            return false;
        }

        if (typeof regex !== 'string') {
            regex = regex.toString();
        }

        var separator = regex.charAt(0),
            index = regex.length - 1,
            pattern,
            modifier,
            rule;

        while (index > 0) {
            if (/[gimsxeU]/.test(regex.charAt(index))) {
                index--;
            } else {
                break;
            }
        }

        if (regex.charAt(index) !== separator) {
            separator = null;
        }

        if (separator && index !== regex.length - 1) {
            modifier = regex.substr(index + 1, regex.length - 1);
        }

        if (separator) {
            pattern = regex.substr(1, index - 1);
        } else {
            pattern = regex;
        }

        try {
            rule = new RegExp(pattern, modifier);
        } catch (error) {
            _regexDebug();
            return false;
        }

        return rule;

        function _regexDebug() {
            // {debug}
            window.Debug.log({
                'function': '_buildRegexFromString()',
                'arguments': '{pattern: {' + (pattern || '') + '}, modifier: {' + (modifier || '') + '}',
                'message': 'WARNING - Invalid regex given: ' + regex
            });
            window.Debug.print();
            // {/debug}
        }

    }
1088029
private Token match(Token.Kind kind) {
		checkNotEof();
		Token token = tokens.get(index++);
		if (token.kind != kind) {
			syntaxError("expecting \"" + kind + "\" here", token);
		}
		return token;
	}
292105
function(name) {
    var regexp, idx,
      length = this.extraHeaders.length,
      header = this.headers[Utils.headerize(name)];

    if(header) {
      if(header[0]) {
        return header[0];
      }
    } else {
      regexp = new RegExp('^\\s*'+ name +'\\s*:','i');
      for (idx=0; idx<length; idx++) {
        header = this.extraHeaders[idx];
        if (regexp.test(header)) {
          return header.substring(header.indexOf(':')+1).trim();
        }
      }
    }

    return;
  }
504047
function createRegExp (regexp, options) {
    return new DuckType({
      name: options && options.name || null,
      test: function (object) {
        return ((object instanceof String) || typeof(object) === 'string') && regexp.test(object);
      }
    });
  }
1110043
function(name) {
    var idx, length, regexp,
      header = this.headers[Utils.headerize(name)],
      result = [];

    if (header) {
      length = header.length;
      for (idx = 0; idx < length; idx++) {
        result.push(header[idx]);
      }
      return result;
    } else {
      length = this.extraHeaders.length;
      regexp = new RegExp('^\\s*'+ name +'\\s*:','i');
      for (idx=0; idx<length; idx++) {
        header = this.extraHeaders[idx];
        if (regexp.test(header)) {
          result.push(header.substring(header.indexOf(':')+1).trim());
        }
      }
      return result;
    }
  }
625041
String regExpGroupName(String elementName) {
        for (String regexp : sortedRegExpList) {
            if (elementName.startsWith(regexp)) {
                return regExpGroupMap.get(regexp);
            }
        }
        return null;
    }
385758
function createNamedRegex(regexp, flags) {

    if (typeof regexp === "boolean") {
      // options parameter
      if (regexp === false) {
        cache = undefined;
      } else if (!cache) {
        cache = {};
      }
      return;
    }

    if (typeof regexp !== "string") {
      // parameter is regexp literal
      flags = (regexp.global ? "g" : "") +
        (regexp.multiline ? "m" : "") +
        (regexp.ignoreCase ? "i" : "");
      regexp = regexp.source;
    }

    var info = cache ? (cache[regexp] || (cache[regexp] = parseRegex(regexp))) : parseRegex(regexp);
    var regex = new RegExp(info.regexText, flags);

    regex.groupsIndices = info.mapper;

    function extendMatched(matched) {
      var mapper = info.mapper;
      /**
      * Returns value for group name or undefined. If same group name was defined multiple time, it returns first not undefined value.
      * If all is set to true, then it returns array of all matched values.
      */
      matched.group = function (name, all) {
        var indices = mapper[name];
        if (typeof indices === "number") {
          // name group is defined only once
          return matched[indices];
        } else if (all) {
          // name group is defined multiple time and because all is true, return array of all matched values
          return indices.map(function (v) { return matched[v]; });
        } else if (indices) {
          // name group is defined multiple time and because all is false, return first not undefined matched value
          for (var i = 0; i < indices.length; ++i) {
            var value = matched[indices[i]];
            if (value !== undefined) {
              return value;
            }
          }
        }
        return undefined;
      };
      var cachedGroups, cachedGroupsAll;
      matched.groups = function (all) {
        var cg = all ? cachedGroupsAll : cachedGroups;
        if (cg) {
          return cg;
        }
        cg = {};
        for (var name in mapper) {
          cg[name] = matched.group(name, all);
        }
        return all ? cachedGroupsAll = cg : cachedGroups = cg;
      };
      return matched;
    }

    regex.exec = function (text) {
      var matched = RegExp.prototype.exec.call(this, text);
      if (matched) {
        extendMatched(matched);
      }
      return matched;
    }
    regex.execGroups = function (text, all) {
      var matched = this.exec(text);
      if (!matched) {
        return null;
      }
      return matched.groups(all);
    }

    regex.replace = function (text, replacement) {
      if (typeof replacement === "function") {
        return text.replace(regex, function () {
          var matched = Array.prototype.slice.call(arguments, 0, arguments.length - 2);
          extendMatched(matched);
          return replacement.apply(matched, arguments);
        });
      } else {
        var replacementText = parseReplacement(replacement, this.groupsIndices);
        return text.replace(this, replacementText);
      }
    }
    return regex;
  }
514373
def regexNamer(regex, usePageUrl=False):
    """"""
    @classmethod
    def _namer(cls, imageUrl, pageUrl):
        """Get first regular expression group."""
        url = pageUrl if usePageUrl else imageUrl
        mo = regex.search(url)
        if mo:
            return mo.group(1)
    return _namer
323054
function search(regexp) {
        var O = requireObjectCoercible(this);
        var searcher = regexp == undefined ? undefined : regexp[SEARCH];
        return searcher !== undefined ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
      }