WordPress Version: 6.1
/**
* Retrieves the combined regular expression for HTML and shortcodes.
*
* @access private
* @ignore
* @internal This function will be removed in 4.5.0 per Shortcode API Roadmap.
* @since 4.4.0
*
* @param string $shortcode_regex Optional. The result from _get_wptexturize_shortcode_regex().
* @return string The regular expression
*/
function _get_wptexturize_split_regex($shortcode_regex = '')
{
static $html_regex;
if (!isset($html_regex)) {
// phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- don't remove regex indentation
$comment_regex = '!' . '(?:' . '-(?!->)' . '[^\-]*+' . ')*+' . '(?:-->)?';
// End of comment. If not found, match all input.
$html_regex = '<' . '(?(?=!--)' . $comment_regex . '|' . '[^>]*>?' . ')';
// phpcs:enable
}
if (empty($shortcode_regex)) {
$regex = '/(' . $html_regex . ')/';
} else {
$regex = '/(' . $html_regex . '|' . $shortcode_regex . ')/';
}
return $regex;
}