/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/
To use this expression follow the code below.
//Save the expression in a variable.
$correct_htmltag_format = "/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/";
//some input from a user through a text field or from a server.
$user_input = $_REQUEST['html_tag'];
//match the two input's and save it in a variable.
tag_match = preg_match($correct_htmltag_format, $user_input);
//Condition goes here.
if(tag_match){
echo "Correct HTML Tag";
}
else{
echo "Incorrect HTML Tag";
}