Lines Matching defs:patterns
16 * Any of the contained patterns could match and when one does it's label is returned.
20 /** @var string[] patterns to match */
21 protected $patterns = [];
22 /** @var string[] labels for above patterns */
24 /** @var string the compound regex matching all patterns */
30 * Constructor. Starts with no patterns.
53 $count = count($this->patterns);
54 $this->patterns[$count] = $pattern;
60 * Attempts to match all patterns at once against a string.
69 if (count($this->patterns) == 0) {
89 * Attempts to split the string against all patterns at once
99 if (count($this->patterns) == 0) {
127 [$pre, $post] = preg_split($this->patterns[$idx] . $this->getPerlMatchingFlags(), $subject, 2);
134 * Compounds the patterns into a single
144 $cnt = count($this->patterns);
155 '[^[()\\\\]+/', $this->patterns[$i], $elts);
186 $this->patterns[$i] = "($pattern)";
188 $this->regex = "/" . implode("|", $this->patterns) . "/" . $this->getPerlMatchingFlags();