I need to select all text in HTML code (but not tags) to add tag to them
and i try to get opposite of <[\/!a-zA-Z0-9]+(\s+\w+(=(\w+|(\"|').*(\"|')))?)*\s*\/?>
like this /^((?!<[\/!a-zA-Z0-9]+(\s+\w+(=(\w+|(\"|').*(\"|')))?)*\s*\/?>).)*$/
(link)
all i want to do is convert this:
<!DOCTYPE html>
<html>
<body>
<h1>Heading</h1>
<div><p>paragraph.</p></div>
<p>paragraph.</p>
</body>
</html>
to this:
<!DOCTYPE html>
<html>
<body>
<h1><span>Heading</span></h1>
<div><p><span>paragraph.</span></p></div>
<p><span>paragraph.</span></p>
</body>
</html>
please help.thx