WordPress Version: 6.1
/**
* Retrieves the regular expression for shortcodes.
*
* @access private
* @ignore
* @since 4.4.0
*
* @param string[] $tagnames Array of shortcodes to find.
* @return string The regular expression
*/
function _get_wptexturize_shortcode_regex($tagnames)
{
$tagregexp = implode('|', array_map('preg_quote', $tagnames));
$tagregexp = "(?:{$tagregexp})(?=[\\s\\]\\/])";
// Excerpt of get_shortcode_regex().
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
$regex = '\[' . '[\/\[]?' . $tagregexp . '(?:' . '[^\[\]<>]+' . '|' . '<[^\[\]>]*>' . ')*+' . '\]' . '\]?';
// Shortcodes may end with ]].
// phpcs:enable
return $regex;
}