Specify ||-separated strings to limit pages processed to those whose
HTML contains any of the content strings.

@param array $pattern
@return $this
514024
public function setPageProcessPatterns(array $pattern)
    {
        $this->otherOptions['pageProcessPattern'] = implode("||",
            array_map(function ($item) {
                return urlencode($item);
            }, $pattern));

        return $this;
    }
37035
public function addRaw(string $pattern): self
    {
        if (substr($pattern, 0, 2)=='./') {
            $pattern = substr($pattern, 2);
        }
        if (!in_array($pattern, $this->raws)) {
            $this->raws[] = $pattern;
        }

        return $this;
    }
747265
public function grep($pattern)
    {
        $results = array_intersect_key($this->attributes, array_flip(
            RegexGuard::getGuard()->grep($pattern, array_keys($this->attributes))
        ));

        return new static($results);
    }
730941
public function addRule($pattern, $method = 'all')
    {
        if (is_array($pattern)) {
            foreach ($pattern as $_pattern) {
                $this->addRule($_pattern, $method);
            }
            return $this;
        }
        //解析URL段
        $this->rules[$pattern.'~~'.$method] = [$method, $this->parseRule($pattern)];
        return $this;
    }
910155
public function rest($pattern, $action)
    {
        is_array($action) ? $action['__rest'] = 1 : $action = ['__rest' => 0, '__action' => $action];
        $this->addRoute($this->httpMethod, $pattern, $action);
        return $this;
    }
119958
public function orLike($column, $pattern)
    {
        $this->conditions[] = 'OR ' . $this->grammar->buildId($column) . ' LIKE ' . $pattern;

        return $this;
    }
57466
public function glob($pattern)
    {
        if (!is_string($pattern)) {
            throw new InvalidStringException('pattern', $pattern);
        } elseif (empty($pattern)) {
            throw new InvalidNotEmptyException('pattern');
        }

        if (!is_string($this->value)) {
            throw new InvalidStringException($this->name, $this->value);
        } elseif (!fnmatch($pattern, $this->value)) {
            throw new StringNotMatchGlobException($this->name, $this->value, $pattern);
        }

        return $this;
    }
185752
public static function normalize($pattern)
	{
		//normalize the string pattern and return safe pattern for use
		return self::$delimiter.trim($pattern, self::$delimiter).self::$delimiter;

	}
700773
protected function split(array &$str, $pattern)
    {
        $tokens = array();
        foreach ($str as $s) {
            $tokens = array_merge(
                $tokens,
                preg_split($pattern, $s, null, PREG_SPLIT_NO_EMPTY)
            );
        }

        $str = $tokens;
    }
669861
public function filter($pattern)
    {
        return new self(array_filter($this->items, function (AcceptHeaderItem $item) use ($pattern) {
            return preg_match($pattern, $item->getValue());
        }));
    }
68057
public function andLike($column, $pattern)
    {
        $this->conditions[] = 'AND ' . $this->grammar->buildId($column) . ' LIKE ' . $pattern;

        return $this;
    }
1230763
public function setInclude(string $pattern, string $flags = null): self
    {
        if (null === $flags) {
            return $this->setParam('include', $pattern);
        }

        return $this->setParam('include', [
            'pattern' => $pattern,
            'flags' => $flags,
        ]);
    }
1021731
public function set_pattern($pattern=1) {
        if ($pattern > 0) {
            if (!isset($this->format['fill']['color']['rgb'])) {
                $this->set_bg_color('black');
            }
        } else {
            unset($this->format['fill']['color']['rgb']);
            unset($this->format['fill']['type']);
        }
    }
1020362
public function setExclude(string $pattern, string $flags = null): self
    {
        if (null === $flags) {
            return $this->setParam('exclude', $pattern);
        }

        return $this->setParam('exclude', [
            'pattern' => $pattern,
            'flags' => $flags,
        ]);
    }
887964
public function filterExcept($patterns = [])
    {
        if (empty($patterns)) {
            return $this;
        }

        $toExclude = $this->filterMatch($patterns)->keys()->toArray();

        return $this->except($toExclude);
    }
1246162
public function name($pattern)
	{
		$regex = FilenameMatch::translate($pattern);
		$this->names[] = $regex;

		return $this;
	}
1069467
private function preparePattern($pattern)
    {
        $delimiterPattern = '/\\\\*' . self::DELIMITER . '/';

        // The following block escapes usages of the delimiter in the pattern if it's not already escaped.
        if (preg_match_all($delimiterPattern, $pattern, $matches, PREG_OFFSET_CAPTURE)) {
            $diffOffset = 0;

            foreach ($matches[0] as $match) {
                $str = $match[0];
                $offset = $match[1] + $diffOffset;

                $escStr = (strlen($str) % 2) ? '\\' . $str : $str; // This will increase an even number of backslashes, before a forward slash, to an odd number.  I.e. '\\/' becomes '\\\/'.

                $diffOffset += strlen($escStr) - strlen($str);

                $pattern = substr_replace($pattern, $escStr, $offset, strlen($str));
            }
        }

        return self::DELIMITER . $pattern . self::DELIMITER . $this->getModifiers();
    }