Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: substitution on

by Taulmarill (Deacon)
on Aug 24, 2009 at 17:09 UTC ( #790868=note: print w/replies, xml ) Need Help??


in reply to substitution on

If you want to replace < with &lt; where it is not part of an HTML tag, a simple solution would be using negative look ahead in your regex like this:
s/<(?![^<]*>)/&lt;/g;
A better solution would be using some HTML parsing module from CPAN.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://790868]
help
Chatterbox?
[Eily]: and you can overload "0+" rather than bool, as numification is used instead of stringification in boolean context when available

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2017-07-27 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (415 votes). Check out past polls.