Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Regular expression

by toolic (Chancellor)
on Feb 02, 2012 at 14:32 UTC ( #951448=note: print w/ replies, xml ) Need Help??


in reply to Regular expression

I see no need for the while loop:

use warnings; use strict; undef $/; my $content = <DATA>; $content =~ s/<span style="font.*/<span style="font-weight: bold;">/gi +; print "$content\n"; __DATA__ <span style="font-weight: bold;color:#000000;"> <span style="font-family:Arial MT;font-size: 25px; font-weight: bold;" +> <span style="color:#000000;" xmlns="http://www.w3.org/1999/xhtml">

prints:

<span style="font-weight: bold;"> <span style="font-weight: bold;"> <span style="color:#000000;" xmlns="http://www.w3.org/1999/xhtml">

See also:


Comment on Re: Regular expression
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (14)
As of 2014-09-18 18:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (120 votes), past polls