Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How do I find $a only where it's not followed by $b and then replace it with $c?

by neshura (Chaplain)
on Feb 15, 2000 at 03:19 UTC ( [id://3496]=note: print w/replies, xml ) Need Help??


in reply to How do I find $a only where it's not followed by $b and then replace it with $c?

Use Perl's cool "zero-width negative lookahead assertion".

s/$a(?!$b)/$c/;

  • Comment on Re: How do I find $a only where it's not followed by $b and then replace it with $c?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found