Description
Handling this via regex is probably not the best way to go, however because there may be reasons for using a regular expression such as "I'm not allowed to install HTMLAgilityPack" then this expression will:
- find all tags which are simply open tag followed by a close tag
- will avoid many of the edge cases that make pattern matching in HTML with regex difficult
Regex: (<(\w+)(?=\s|>)(?:[^'">=]*|='[^']*'|="[^"]*"|=[^'"][^\s>]*)*>)(<\/\2>)
Replace with: $1~~~NewValue~~~$3

Example
Live Demo
Sample Text
Note the first line has some really difficult edge cases
<a onmouseover=' str=" <a></a> " ; if ( 6 > 4 ) { funDoSomething(str); } '></a>
<div></div>
<span>test</span>
<a></a>
Text After Replacement
<a onmouseover=' str=" <a></a> " ; if ( 6 > 4 ) { funDoSomething(str); } '>~~~NewValue~~~</a>
<div>~~~NewValue~~~</div>
<span>test</span>
<a>~~~NewValue~~~</a>