WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/get tag regex

Description

Returns Regular Expression to liberally match an opening HTML tag that:

1. Is self-closing or
2. Has no body but has a closing tag of the same name or
3. Contains a body and a closing tag of the same name

Note: this RegEx does not balance inner tags and does not attempt to produce valid HTML

Parameters

$tag
(string) (required) An HTML tag name. Example: 'video'
Default: None

Return

(string) 
Description.

Usage

 <?php  ?> 

Example

Description text

Example code

Change Log

Source File

get_tag_regex() is located in wp-includes/functions.php.

Related

Function ref links

This article is marked as in need of editing. You can help Codex by editing it.