函数原型
get_tag_regex( string $tag ): string
函数描述
Returns RegEx body to liberally match an opening HTML tag.
是否弃用
未弃用
函数参数
-
$tag
string
Required - An HTML tag name. Example:
'video'.
函数返回值
string Tag RegEx.
函数位置
File: wp-includes/functions.php.
函数源码
function get_tag_regex( $tag ) {
if ( empty( $tag ) ) {
return '';
}
return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.6.0 | Introduced. |

