Airship\Engine\Security\Filter\StringFilter::setPattern PHP Method

setPattern() public method

Set a regular expression pattern that the input string must match.
public setPattern ( string $pattern = '' ) : self
$pattern string
return self
    public function setPattern(string $pattern = '') : self
    {
        if (empty($pattern)) {
            $this->pattern = '';
        } else {
            $this->pattern = '#' . \preg_quote($pattern, '#') . '#';
        }
        return $this;
    }