in reply to Re: find and replace
in thread find and replace

Thank you very much for all you guys who helped me.

I came out with a solution some thing like this.

$infile = $ARGV[0]; open(IN, "<$infile"); open(OUT, ">temp.out"); { local $/ = '<exp>'; print OUT scalar <IN>; for (<IN>) { s@([\d\D]*?</exp>)@ my $var = $1; $var =~ s#([a-z|A-z]+)#<it>$1</it>#g; $var =~ s#<<it>(.*?)</it>>#<$1>#g; $var =~ s#</<it>(.*?)</it>>#</$1>#g; $var =~ s#&(.*?)<it>(.*?)</it>(.*?)\;#&$1$2$3;#g; $var @e; print OUT } } close(IN); close(OUT);
Thanks, raj