src/Random.php
protected function extractPattern($string)
    {
        if (is_null($pattern = $this->getPattern())) {
            return $string;
        }

        preg_match_all("/$pattern/", $string, $matches);

        return implode('', $matches[0]);
    }
protected function extractPattern($string)
    {
        if (is_null($pattern = $this->getPattern())) {
            return $string;
        }

        preg_match_all("/$pattern/", $string, $matches);

        return implode('', $matches[0]);
    }
protected function extractPattern ( $ string ) { if ( is_null ( $ pattern = $ this -> getPattern ( ) ) ) { return $ string ; } preg_match_all ( "/$pattern/" , $ string , $ matches ) ; return implode ( '' , $ matches [ 0 ] ) ; }
Extract a string pattern from a string.

@param $string
@return string
Extract a string pattern from a string .