in reply to Re: Question for regex experts
in thread Question for regex experts

Thanks, but this is just a solution for this particular example; I need a general solution for any codes.

Replies are listed 'Best First'.
Re^3: Question for regex experts
by sumeetgrover (Monk) on Jun 27, 2013 at 12:37 UTC

    You need to implement a lookup table that contains a list of all possible, or otherwise a subset, of HTML character codes.

    Therefore, each time your program encounters

    code;
    instead of
    &code;
    , it will need to add an ampersand at the start.