in reply to Re^2: close end tag
in thread close end tag

I think this doesnot match. Before I have to close it. When next '<' some text '>' exists it should close.
#!/usr/bin/perl while(<DATA>){ s/(<a\s\w*[=|]\w*)</$1<\/a>/g; print $_; } __DATA__ <a href="www.google.txt>Click here<span>