in reply to Re^6: Thanks to Ikegami, Chromatic & Corion
in thread Thanks to Ikegami, Chromatic & Corion

Got it!

my %escapes = ( '&lab;' => '<', '&rab;' => '>', '&lcb;' => '(', '&rcb;' => ')', '&lsb;' => '[', '&rsb;' => ']' ); my $escapes_re = qr/&[lr][acs]b;/; $aXML =~ s/($escapes_re)/$escapes{$1}/g;

Replies are listed 'Best First'.
Re^8: Thanks to Ikegami, Chromatic & Corion
by ikegami (Patriarch) on Nov 02, 2011 at 05:14 UTC

    That won't work. you need to handle those sequences, <special> and <post_include> at the same time, not before (which would break "&lab;special>lab&lab;/special>") or after (which would break "<special>lab</special>"). I've covered what would work elsewhere.

    A reply falls below the community's threshold of quality. You may see it by logging in.