public function getMatchPattern()
    {
        if ($this->validationPattern) {
            $pattern = $this->validationPattern;
        } elseif ($enum = $this->getEnum()) {
            $pattern = '^(' . \implode('|', \array_map('preg_quote', $enum)) . ')$';
        } else {
            switch ($this->getType()) {
                case self::TYPE_NUMBER:
                    // @see http://www.regular-expressions.info/floatingpoint.html
                    $pattern = '[-+]?[0-9]*\.?[0-9]+';

                    break;
                case self::TYPE_INTEGER:
                    $pattern = '[-+]?[0-9]+';

                    break;
                case self::TYPE_DATE:
                    // @see https://snipt.net/DamienGarrido/http-date-regular-expression-validation-rfc-1123rfc-850asctime-f64e6aa3/
                    $pattern = '^(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:[0-2][0-9]|3[01]) ' .
                        '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} ' .
                        '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] ' .
                        'GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), ' .
                        '(?:[0-2][0-9]|3[01])-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2} ' .
                        '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) ' .
                        '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?:[ 1-2][0-9]|3[01]) ' .
                        '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] \d{4})$';

                    break;
                case self::TYPE_BOOLEAN:
                    $pattern = '(true|false)';

                    break;
                case self::TYPE_FILE:
                    $pattern = '([^/]+)';

                    break;
                case self::TYPE_STRING:
                    $pattern = $this->getMinLength() || $this->getMaxLength() ? '((?!\/).){' . $this->getMinLength() . ',' . $this->getMaxLength() . '}' : '([^/]+)';

                    break;
                default:
                    $pattern = '([^/]+)';
            }
        }

        return $pattern;
    }
public function getMatchPattern()
    {
        if ($this->validationPattern) {
            $pattern = $this->validationPattern;
        } elseif ($enum = $this->getEnum()) {
            $pattern = '^(' . \implode('|', \array_map('preg_quote', $enum)) . ')$';
        } else {
            switch ($this->getType()) {
                case self::TYPE_NUMBER:
                    // @see http://www.regular-expressions.info/floatingpoint.html
                    $pattern = '[-+]?[0-9]*\.?[0-9]+';

                    break;
                case self::TYPE_INTEGER:
                    $pattern = '[-+]?[0-9]+';

                    break;
                case self::TYPE_DATE:
                    // @see https://snipt.net/DamienGarrido/http-date-regular-expression-validation-rfc-1123rfc-850asctime-f64e6aa3/
                    $pattern = '^(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:[0-2][0-9]|3[01]) ' .
                        '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} ' .
                        '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] ' .
                        'GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), ' .
                        '(?:[0-2][0-9]|3[01])-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2} ' .
                        '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) ' .
                        '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?:[ 1-2][0-9]|3[01]) ' .
                        '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] \d{4})$';

                    break;
                case self::TYPE_BOOLEAN:
                    $pattern = '(true|false)';

                    break;
                case self::TYPE_FILE:
                    $pattern = '([^/]+)';

                    break;
                case self::TYPE_STRING:
                    $pattern = $this->getMinLength() || $this->getMaxLength() ? '((?!\/).){' . $this->getMinLength() . ',' . $this->getMaxLength() . '}' : '([^/]+)';

                    break;
                default:
                    $pattern = '([^/]+)';
            }
        }

        return $pattern;
    }
public function getMatchPattern ( ) { if ( $ this -> validationPattern ) { $ pattern = $ this -> validationPattern ; } elseif ( $ enum = $ this -> getEnum ( ) ) { $ pattern = '^(' . \ implode ( '|' , \ array_map ( 'preg_quote' , $ enum ) ) . ')$' ; } else { switch ( $ this -> getType ( ) ) { case self :: TYPE_NUMBER : // @see http://www.regular-expressions.info/floatingpoint.html $ pattern = '[-+]?[0-9]*\.?[0-9]+' ; break ; case self :: TYPE_INTEGER : $ pattern = '[-+]?[0-9]+' ; break ; case self :: TYPE_DATE : // @see https://snipt.net/DamienGarrido/http-date-regular-expression-validation-rfc-1123rfc-850asctime-f64e6aa3/ $ pattern = '^(?:(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (?:[0-2][0-9]|3[01]) ' . '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{4} ' . '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] ' . 'GMT|(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), ' . '(?:[0-2][0-9]|3[01])-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{2} ' . '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] GMT|(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) ' . '(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (?:[ 1-2][0-9]|3[01]) ' . '(?:[01][0-9]|2[0-3]):[012345][0-9]:[012345][0-9] \d{4})$' ; break ; case self :: TYPE_BOOLEAN : $ pattern = '(true|false)' ; break ; case self :: TYPE_FILE : $ pattern = '([^/]+)' ; break ; case self :: TYPE_STRING : $ pattern = $ this -> getMinLength ( ) || $ this -> getMaxLength ( ) ? '((?!\/).){' . $ this -> getMinLength ( ) . ',' . $ this -> getMaxLength ( ) . '}' : '([^/]+)' ; break ; default : $ pattern = '([^/]+)' ; } } return $ pattern ; }
Get a regex pattern for matching the parameter

@return string
Get a regex pattern for matching the parameter