public function highlight($htmlString)
    {
        $tags = implode('|', $this->validContainers);
        $pattern = '#(<(' . $tags . ')[^>]'.$this->langAttribute . '=["\']+([^\'".]*)["\']+>)(.*?)(</\2\s*>|$)#s';
        /*
         matches[0] = whole string
         matches[1] = open tag including lang attribute
         matches[2] = tag name
         matches[3] = value of lang attribute
         matches[4] = text to be highlighted
         matches[5] = end tag
        */
        return preg_replace_callback($pattern, array($this, '_processCodeBlock'), $htmlString);
    }
public function highlight($htmlString)
    {
        $tags = implode('|', $this->validContainers);
        $pattern = '#(<(' . $tags . ')[^>]'.$this->langAttribute . '=["\']+([^\'".]*)["\']+>)(.*?)(</\2\s*>|$)#s';
        /*
         matches[0] = whole string
         matches[1] = open tag including lang attribute
         matches[2] = tag name
         matches[3] = value of lang attribute
         matches[4] = text to be highlighted
         matches[5] = end tag
        */
        return preg_replace_callback($pattern, array($this, '_processCodeBlock'), $htmlString);
    }
public function highlight ( $ htmlString ) { $ tags = implode ( '|' , $ this -> validContainers ) ; $ pattern = '#(<(' . $ tags . ')[^>]' . $ this -> langAttribute . '=["\']+([^\'".]*)["\']+>)(.*?)(</\2\s*>|$)#s' ; /*
         matches[0] = whole string
         matches[1] = open tag including lang attribute
         matches[2] = tag name
         matches[3] = value of lang attribute
         matches[4] = text to be highlighted
         matches[5] = end tag
        */ return preg_replace_callback ( $ pattern , array ( $ this , '_processCodeBlock' ) , $ htmlString ) ; }
Highlight a block of HTML containing defined blocks. Converts blocks from plain text
into highlighted code.

@param string $htmlString
@return void
Highlight a block of HTML containing defined blocks . Converts blocks from plain text into highlighted code .