From: Ben Siders [EMAIL PROTECTED]
I've got a real easy one here (in theory). I have some XML files that
were generated by a program, but generated imperfectly. There's some
naked ampersands that need to be converted to amp;. I need a regexp
that will detect them and change them. Sounds
Toby Stuart wrote:
Try this one:
s/(?!\w+;)/amp;/g
Problem is that this will break things like
#64;
Jenda
= [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
--
Jenda Krynicky wrote:
Toby Stuart wrote:
Try this one:
s/(?!\w+;)/amp;/g
Problem is that this will break things like
#64;
Why not just:
s/(?!amp;)/amp;/g
i.e. change every ampersand that isn't followed by 'amp;' into amp;
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
-Original Message-
From: Ben Siders [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 16, 2003 7:38 AM
To: Perl
Subject: Escaping Ampersands in XML
I've got a real easy one here (in theory). I have some XML
files that
were generated by a program, but generated