Re: Escaping Ampersands in XML

2003-01-16 Thread Ben Siders
Because of © I don't want that to get changed. In the end, something like: s/&(?!\w+|[#\d]+;/&/g Works. That might not be quite right, but I think you know what I'm getting at. Rob Dixon wrote: Jenda Krynicky wrote: Toby Stuart wrote: Try this one: s/&(?!\w+;)/&/g Proble

Re: Escaping Ampersands in XML

2003-01-16 Thread Rob Dixon
Jenda Krynicky wrote: >> Toby Stuart wrote: >>> Try this one: >>> >>> s/&(?!\w+;)/&/g > > Problem is that this will break things like > @ > Why not just: s/&(?!amp;)/&/g i.e. change every ampersand that isn't followed by 'amp;' into & Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: Escaping Ampersands in XML

2003-01-16 Thread Jenda Krynicky
> Toby Stuart wrote: > >Try this one: > > > > s/&(?!\w+;)/&/g Problem is that this will break things like @ 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. --

Re: Escaping Ampersands in XML

2003-01-16 Thread Ben Siders
Whew! That's the same one I finally came up with. Glad to see I was on the right track. The original solution didn't work at all. Toby Stuart wrote: -Original Message- From: Ben Siders [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 16, 2003 7:38 AM To: Perl Subject: Escaping Am

Re: Escaping Ampersands in XML

2003-01-16 Thread Jenda Krynicky
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 &. I need a regexp > that will detect them and change them. Sounds

RE: Escaping Ampersands in XML

2003-01-15 Thread Toby Stuart
> -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 im