Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Question for regex experts

by Sandy (Curate)
on Jun 27, 2013 at 12:18 UTC ( #1041001=note: print w/replies, xml ) Need Help??


in reply to Question for regex experts

perl -e '$x=qw(&apm;gt;lt;amp;);$x=~s/;(.)/;&$1/g;print $x,"\n";'

Replies are listed 'Best First'.
Re^2: Question for regex experts
by evgen-i (Novice) on Jun 27, 2013 at 12:29 UTC
    Thanks, but this is just a solution for this particular example; I need a general solution for any codes.

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1041001]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2021-12-05 13:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (31 votes). Check out past polls.

    Notices?