Hello LanX,
I missed the semicolon because of the question’s formatting, but I don’t think you need a look-behind to handle it; a simple look-ahead seems to be enough:
21:08 >perl -wE "my $x = '<Remarks>1 SW PLT SLAC 6 PCS </Remarks>' +; $x =~ s/&#\d(?!\d);?//g; say $x;" <Remarks>1 SW PLT SLAC 6 PCS </Remarks> 21:08 >perl -wE "my $x = '<Remarks>1 SW PLT SLAC 6 PCS &</Remarks> +'; $x =~ s/&#\d(?!\d);?//g; say $x;" <Remarks>1 SW PLT SLAC 6 PCS &</Remarks> 21:09 >perl -wE "my $x = '<Remarks>1 SW PLT SLAC 6 PCS </Remarks>'; + $x =~ s/&#\d(?!\d);?//g; say $x;" <Remarks>1 SW PLT SLAC 6 PCS </Remarks> 21:09 >
Or am I still missing something?
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re^2: Need a regex to replace incomplete html entities
by Athanasius
in thread Need a regex to replace incomplete html entities
by Chris Daniel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |