Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Answer: How do i find $a and replace it with $b when it's preceded by $c?

( #71091=categorized answer: print w/ replies, xml ) Need Help??

Q&A > regular expressions > How do i find $a and replace it with $b when it's preceded by $c? contributed by Anonymous Monk

I did a benchmark, and the fastest solution is s/$c$a/$c$b/g. Don't use backreferences unless you have to.

Comment on Answer: How do i find $a and replace it with $b when it's preceded by $c?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (16)
As of 2014-07-23 13:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (143 votes), past polls