getRegex(); $options = $var->options; if ($options['modifier']) { switch ($options['modifier']) { case '*': // 2 | 4 $regex = "{$value}+(?:{$this->sep}{$value}+)*"; break; case ':': $regex = $value . '{0,' . $options['value'] . '}'; break; case '%': throw new \InvalidArgumentException('% (array) modifier only works with Named type operators e.g. ;,?,&'); default: throw new \InvalidArgumentException("Unknown modifier `{$options['modifier']}`"); } } else { // 1, 3 $regex = "{$value}*(?:,{$value}+)*"; } return $regex; } }