Uses
| Uses | Description |
|---|---|
| wp-includes/formatting.php: tag_escape() | Escape an HTML tag name. |
Return RegEx body to liberally match an opening HTML tag.
Matches an opening HTML tag that:
Note: this RegEx does not balance inner tags and does not attempt to produce valid HTML
(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. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/get_tag_regex