in reply to Pattern Matching
Hi Gubendran,
$str=~s#(.+)<index-entry id[^>]+>\s*<index-heading></index-heading>\s* +</index-entry>#$1#gs; [download]
use .+ for getting last <index-heading>
Thanx
Gopal.R