How to print ending tag if the clsing tag doesnot exists before the start of another tag or start of character '[' Where the output should be like#!/usr/bin/perl while(<DATA>){ s/<(\w*)>(?![^<\w*\>]*<\w*\\>)/<\/$1>/g; print $_; } __DATA__ Susan Kempf<BR>LONGWOOD<BR> <p>Joe</p> DJ ROB-E ORLANDO<QC> BREAKZ, VOL. 2 <Hi>How r y</HI><br> [HELOO]
Susan Kempf<BR>LONGWOOD</BR><BR> </BR><p>Joe</p> DJ ROB-E ORLANDO<QC> BREAKZ, VOL. 2</QC> <Hi>How r y</HI><br> </br>[HELLO]
In reply to close end tag by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |