src/Decorator/Parser/Ansi.php
protected function parse($str)
    {
        $count = preg_match_all($this->tags->regex(), $str, $matches);

        // If we didn't find anything, return the string right back
        if (!$count || !is_array($matches)) {
            return $str;
        }

        // All we want is the array of actual strings matched
        $matches = reset($matches);

        return $this->parseTags($str, $matches);
    }
protected function parse($str)
    {
        $count = preg_match_all($this->tags->regex(), $str, $matches);

        // If we didn't find anything, return the string right back
        if (!$count || !is_array($matches)) {
            return $str;
        }

        // All we want is the array of actual strings matched
        $matches = reset($matches);

        return $this->parseTags($str, $matches);
    }
protected function parse ( $ str ) { $ count = preg_match_all ( $ this -> tags -> regex ( ) , $ str , $ matches ) ; // If we didn't find anything, return the string right back if ( ! $ count || ! is_array ( $ matches ) ) { return $ str ; } // All we want is the array of actual strings matched $ matches = reset ( $ matches ) ; return $ this -> parseTags ( $ str , $ matches ) ; }
Parse the string for tags and replace them with their codes

@param  string $str

@return string
Parse the string for tags and replace them with their codes