Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: trouble with regular expressions

by programmer.perl (Beadle)
on Nov 06, 2012 at 14:51 UTC ( #1002495=note: print w/ replies, xml ) Need Help??


in reply to Re: trouble with regular expressions
in thread trouble with regular expressions

I want to change this whole word to //eof

my old code matches the ;doc and gives result such as ssscument.write('<iframe ...shortened...</iframe>');

and thank you for your reply ))

Enough codes make shapes. (Hamidjon)


Comment on Re^2: trouble with regular expressions
Select or Download Code
Replies are listed 'Best First'.
Re^3: trouble with regular expressions
by moritz (Cardinal) on Nov 06, 2012 at 15:00 UTC
    my old code matches the ;doc and gives result such as ssscument.write('<iframe ...shortened...</iframe>');

    No, it does not:

    use 5.010; use strict; use warnings; $_ = q[;document.write('<iframe src="any url" scrolling="auto" framebo +rder="no" align="center" height="15" width="15"></iframe>');]; s/(\;do.*)(\<\/iframe\>\'\)\;)/sss/; say __END__ sss

    Anyway, it's easier if you use a different delimiter so that you don't have to escape the forward slashes:

    s{(\;do.*)(</iframe>'\);)}{//eof};
Re^3: trouble with regular expressions
by programmer.perl (Beadle) on Nov 06, 2012 at 14:54 UTC

    sorry, I made a gram. mistake: I want to change this whole string to //eof

    Enough codes make shapes. (Hamidjon)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (15)
As of 2015-07-29 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (263 votes), past polls