preg_quote( $t, '/' ), $tags ) ); return '\\[\\/?(?:' . $names . ')(?![\\w-])[^\\[\\]]*\\]'; } /** The text without registered shortcode tags. */ public static function strip( string $text ): string { $pattern = self::pattern(); return '' === $pattern || ! str_contains( $text, '[' ) ? $text : (string) preg_replace( '/' . $pattern . '/u', '', $text ); } }