Set a pattern option value
@param  {String}        the name of the pattern
@param  {String}        the name of the option to set
@param  {String}        the name of the value to give to it

@return {Boolean}       if it was set or not
540875
public static function setPatternOption($patternStoreKey,$optionName,$optionValue) {

		if (isset(self::$store[$patternStoreKey])) {

			self::$store[$patternStoreKey][$optionName] = $optionValue;
			return true;

		}

		return false;

	}
58268
function (pattern, options) {
    options = options || {};
    this.pattern = new Pattern(pattern, options);
    this.recurse = this.shouldRecurse(this.pattern, options);

    // if middleware are registered, use the glob, otherwise regex
    var glob = this.fns.length
      ? this.pattern.glob
      : this.pattern.regex;

    this.defaults(glob, options);
    this.include(glob, options);
    return this;
  }
551953
function(opts){

	if(!opts) opts = {};

	this.shortcodes = {};

	this.options = {
		openPattern: opts.openPattern || '\\[',
		closePattern: opts.closePattern || '\\]'
	};

}
176431
function isNotAPattern(pattern) {
  let set = new Minimatch(pattern).set;
  if (set.length > 1) {
    return false;
  }

  for (let j = 0; j < set[0].length; j++) {
    if (typeof set[0][j] !== 'string') {
      return false;
    }
  }

  return true;
}
1114135
function setOption(options, name, value) {
            if (typeof options[name] === 'undefined')
                options[name] = value;
            else {
                if (!Array.isArray(options[name]))
                    options[name] = [ options[name] ];
                options[name].push(value);
            }
        }
410523
function any(/* patterns... */) {
        var patterns = [].slice.call(arguments, 0);
        var name = '(' + patterns.join(' | ') + ')';

        return new Pattern(name, function (str, pos) {
            var r, i;
            for (i = 0; i < patterns.length && !r; i++)
                r = patterns[i].exec(str, pos);
            return r;
        });
    }
1038975
public function setPattern($pattern)
    {
        if (!is_array($pattern) && !is_string($pattern)) {
            throw new Exception\InvalidArgumentException(sprintf(
                '%s expects pattern to be array or string; received "%s"',
                __METHOD__,
                (is_object($pattern) ? get_class($pattern) : gettype($pattern))
            ));
        }

        if (is_array($pattern)) {
            foreach ($pattern as $p) {
                $this->validatePattern($p);
            }
        }

        if (is_string($pattern)) {
            $this->validatePattern($pattern);
        }

        $this->options['pattern'] = $pattern;
        return $this;
    }
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;

        }
437901
function (options) {
        _.has(options, 'pattern') && (_.isString(options.pattern) && !_.isEmpty(options.pattern)) &&
            (this.pattern = options.pattern);

        // create a match pattern and store it on cache
        this._matchPatternObject = this.createMatchPattern();
    }
946946
function RoutePattern(options) {
    // The route string are compiled to a regexp (if it isn't already)
    this.pathPattern = options.pathPattern;
    this.queryStringPattern = options.queryStringPattern;
    this.hashPattern = options.hashPattern;

    // The original routestring (optional)
    this.routeString = options.routeString;
  }
77651
function buildPattern(patternObj, options) {
  const patternFile = { path: patternObj.path };
  return Object.assign(patternObj, {
    name:
      (patternObj.data && patternObj.data.name) ||
      titleCase(resourceKey(patternFile))
  });
}
823935
def set_rule_option(self, rule_name_or_id, option_name, option_value):
        
        option = self._get_option(rule_name_or_id, option_name)
        try:
            option.set(option_value)
        except options.RuleOptionError as e:
            msg = u"'{0}' is not a valid value for option '{1}.{2}'. {3}."
            raise LintConfigError(msg.format(option_value, rule_name_or_id, option_name, ustr(e)))
552575
function makeRe(pattern, options) {
  if (pattern instanceof RegExp) {
    return pattern;
  }

  if (typeof pattern !== 'string') {
    throw new TypeError('expected a string');
  }

  if (pattern.length > MAX_LENGTH) {
    throw new Error('expected pattern to be less than ' + MAX_LENGTH + ' characters');
  }

  var key = pattern;
  // do this before shallow cloning options, it's a lot faster
  if (!options || (options && options.cache !== false)) {
    key = createKey(pattern, options);

    if (cache.hasOwnProperty(key)) {
      return cache[key];
    }
  }

  var opts = extend({}, options);
  if (opts.contains === true) {
    if (opts.negate === true) {
      opts.strictNegate = false;
    } else {
      opts.strict = false;
    }
  }

  if (opts.strict === false) {
    opts.strictOpen = false;
    opts.strictClose = false;
  }

  var open = opts.strictOpen !== false ? '^' : '';
  var close = opts.strictClose !== false ? '$' : '';
  var flags = opts.flags || '';
  var regex;

  if (opts.nocase === true && !/i/.test(flags)) {
    flags += 'i';
  }

  try {
    if (opts.negate || typeof opts.strictNegate === 'boolean') {
      pattern = not.create(pattern, opts);
    }

    var str = open + '(?:' + pattern + ')' + close;
    regex = new RegExp(str, flags);

    if (opts.safe === true && safe(regex) === false) {
      throw new Error('potentially unsafe regular expression: ' + regex.source);
    }

  } catch (err) {
    if (opts.strictErrors === true || opts.safe === true) {
      err.key = key;
      err.pattern = pattern;
      err.originalOptions = options;
      err.createdOptions = opts;
      throw err;
    }

    try {
      regex = new RegExp('^' + pattern.replace(/(\W)/g, '\\$1') + '$');
    } catch (err) {
      regex = /.^/; //<= match nothing
    }
  }

  if (opts.cache !== false) {
    memoize(regex, key, pattern, opts);
  }
  return regex;
}
78169
function brackets(pattern, options) {
  const res = brackets.create(pattern, options);
  return res.output;
}
1229864
public static boolean safeRegexMatch(String pattern, String value) {
        if (StringUtils.isNotBlank(pattern)) {
            if (value == null) {
                return false;
            } else {
                try {
                    return Pattern.matches(pattern, value);
                } catch (PatternSyntaxException ex) {
                    return false;
                }
            }
        } else {
            return false;
        }
    }
622376
function setOption(arg)
{
  arg = arg.split('=')

  var key, value

  if(arg.length > 1)
  {
    key   = arg.shift()
    value = arg.join('=')
  }
  else
  {
    key = arg
    value = true
  }

  this[key] = value
}
1014332
function cmd(patterns, options) {
  var str = normalize(patterns);
  var keys = Object.keys(options);
  var args = [];
  var valid = [
    'dotglob',
    'extglob',
    'failglob',
    'globstar',
    'nocaseglob',
    'nullglob'
  ];

  for (var i = 0; i < keys.length; i++) {
    var key = keys[i];
    if (valid.indexOf(key) !== -1) {
      args.push('-O', key);
    }
  }

  args.push('-c', 'for i in ' + str + '; do echo $i; done');
  return args;
}