Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
However, I'm struggling with how to find and replace all ampersands that would not match the previous expression...I know what I want to do, but am wrestling with the logic of how to do it. Can anyone offer suggestions?m/(&(?:(?:#x[\da-f]+)|(?:#\d+)|(?:[a-z]+));)/i
For example, the following would be before processing:
And this would be after processing:Purus Accumsan Felis ‰ Maecenas Nibh θ Eget Phasellus & Mi + Amet. Odio Amet && Purus. Mi Ullamcorper Lorem Eget Nibh. http://www.example.com/?name=John&residence=Vatican+City&job=Pope
Purus Accumsan Felis ‰ Maecenas Nibh θ Eget Phasellus & +; Mi Amet. Odio Amet && Purus. Mi Ullamcorper Lorem Eget Ni +bh. http://www.example.com/?name=John&residence=Vatican+City&job=P +ope
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching ampersands that are NOT part of an HTML entity?
by Your Mother (Archbishop) on Aug 07, 2008 at 00:41 UTC | |
by EvanK (Chaplain) on Aug 07, 2008 at 15:12 UTC | |
by Your Mother (Archbishop) on Aug 07, 2008 at 15:18 UTC | |
|
Re: Matching ampersands that are NOT part of an HTML entity?
by ikegami (Patriarch) on Aug 06, 2008 at 21:49 UTC | |
by AnomalousMonk (Archbishop) on Aug 07, 2008 at 00:19 UTC | |
by JavaFan (Canon) on Aug 07, 2008 at 12:02 UTC | |
by ikegami (Patriarch) on Aug 07, 2008 at 12:57 UTC | |
|
Re: Matching ampersands that are NOT part of an HTML entity?
by bart (Canon) on Aug 07, 2008 at 21:46 UTC |