$str =~ s/&(.*?);/&$1 ;/g;
perhaps? Your code as it stands seems to lose the text after the ampersand.
Cheers,
JohnGG
In reply to Re^2: simple regexp question
by johngg
in thread simple regexp question
by KarthikK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |