Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

(jeffa) Re: Regex help

by jeffa (Bishop)
on Oct 01, 2002 at 19:54 UTC ( #202091=note: print w/replies, xml ) Need Help??


in reply to Regex help

I have used this one with good success in the past:
s/<\s*(?:no)?script.*<\/(?:no)?script\s*>//sig;
it only works on a scalar, so you will need to slurp your entire JS code into a scalar first. I am sure others have better regexes, but i thought i should share. :)

UPDATE:
fixed (i think) ... thanks sauoq :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Regex help
by sauoq (Abbot) on Oct 01, 2002 at 21:08 UTC

    That won't match: Yes. It's fixed now.

    <script> // Malicious code. </script >
    -sauoq
    "My two cents aren't worth a dime.";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://202091]
help
Chatterbox?
[Corion]: Hi marto!
[marto]: Hey Corion, how are things?
[Corion]: Fine! It's amazing how productive I can be with a 3hour daily workload removed :)
[Corion]: My to-do emails level is at a 12-months-low of 21 , from 36 last week ;)

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2018-05-24 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?