original_string: public static function escape($text)
      {
          $tagregexp = implode('|', array_map('preg_quote', static::_list()));
          preg_match_all('/(.?){(' . $tagregexp . ')\b(.*?)(?:(\/))?}(?:(.+?){\/\2})?(.?)/s', $text, $matches);
  
          foreach ($matches[0] as $ht) {
              $replace = str_replace_once('{', '{{', $ht);
              $replace = str_replace_last('}', '}}', $replace);
              $text = str_replace($ht, $replace, $text);
          }
  
          return $text;
      }
code: public static function escape($text)
      {
          $tagregexp = implode('|', array_map('preg_quote', static::_list()));
          preg_match_all('/(.?){(' . $tagregexp . ')\b(.*?)(?:(\/))?}(?:(.+?){\/\2})?(.?)/s', $text, $matches);
  
          foreach ($matches[0] as $ht) {
              $replace = str_replace_once('{', '{{', $ht);
              $replace = str_replace_last('}', '}}', $replace);
              $text = str_replace($ht, $replace, $text);
          }
  
          return $text;
      }
code_tokens: public static function escape ( $ text ) { $ tagregexp = implode ( '|' , array_map ( 'preg_quote' , static :: _list ( ) ) ) ; preg_match_all ( '/(.?){(' . $ tagregexp . ')\b(.*?)(?:(\/))?}(?:(.+?){\/\2})?(.?)/s' , $ text , $ matches ) ; foreach ( $ matches [ 0 ] as $ ht ) { $ replace = str_replace_once ( '{' , '{{' , $ ht ) ; $ replace = str_replace_last ( '}' , '}}' , $ replace ) ; $ text = str_replace ( $ ht , $ replace , $ text ) ; } return $ text ; }
docstring: Escapes all shortcodes from the given content.
  
  @param string $text Text from which to escape shortcodes
  @return string Content with all shortcodes escaped
docstring_tokens: Escapes all shortcodes from the given content .