original_string: public function styleText($text)
      {
          if ($this->_outputAs == static::RAW) {
              return $text;
          }
          if ($this->_outputAs == static::PLAIN) {
              $tags = implode('|', array_keys(static::$_styles));
  
              return preg_replace('#</?(?:' . $tags . ')>#', '', $text);
          }
  
          return preg_replace_callback(
              '/<(?P<tag>[a-z0-9-_]+)>(?P<text>.*?)<\/(\1)>/ims',
              [$this, '_replaceTags'],
              $text
          );
      }
code: public function styleText($text)
      {
          if ($this->_outputAs == static::RAW) {
              return $text;
          }
          if ($this->_outputAs == static::PLAIN) {
              $tags = implode('|', array_keys(static::$_styles));
  
              return preg_replace('#</?(?:' . $tags . ')>#', '', $text);
          }
  
          return preg_replace_callback(
              '/<(?P<tag>[a-z0-9-_]+)>(?P<text>.*?)<\/(\1)>/ims',
              [$this, '_replaceTags'],
              $text
          );
      }
code_tokens: public function styleText ( $ text ) { if ( $ this -> _outputAs == static :: RAW ) { return $ text ; } if ( $ this -> _outputAs == static :: PLAIN ) { $ tags = implode ( '|' , array_keys ( static :: $ _styles ) ) ; return preg_replace ( '#</?(?:' . $ tags . ')>#' , '' , $ text ) ; } return preg_replace_callback ( '/<(?P<tag>[a-z0-9-_]+)>(?P<text>.*?)<\/(\1)>/ims' , [ $ this , '_replaceTags' ] , $ text ) ; }
docstring: Apply styling to text.
  
  @param string $text Text with styling tags.
  @return string String with color codes added.
docstring_tokens: Apply styling to text .