in reply to Question for regex experts
As you see, this is not restricted to a particular list of html codes, and that is what I want!$_ = "test;a &lt;>amp;kap;&da;ma; & alfa&romeo & mich;"; while ( s/([&][^ ]*);(?!( |&|$))/\1AMPSEMICOLON/ ) {}; s/AMPSEMICOLON/;\&/g; # Output: test;a &<>&&kap;&da;&ma; & alfa&romeo & mich;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Question for regex experts
by AnomalousMonk (Archbishop) on Jun 27, 2013 at 13:41 UTC |