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

Re: Question for regex experts

by hdb (Prior)
on Jun 27, 2013 at 12:53 UTC ( #1041009=note: print w/replies, xml ) Need Help??


in reply to Question for regex experts

I am not sure my proposal will not create havoc elsewhere in your html (ie how robust it is) but have a look:

use strict; use warnings; my $html = ">lt;amp; something else <gt;amp;something else ; +"; $html =~ s|&(([^ ;]+;)+)| join '', map { "&$_;" } split /;/, $1 |ge; print "$html\n";

UPDATE: Probably \w is more robust than [^ ;].

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041009]
help
Chatterbox?
[Corion]: So now there will be the fun of me explaining to the project that $other_project had low priority because $project has high priority. If $project picks up the task from $other_project, they also will need to reprioritize my tasks to get that done...
[Corion]: ... of course at the cost of something else on my list of tasks for $project, as there only is a finite amount of days until $deadline.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2017-08-17 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (287 votes). Check out past polls.

    Notices?