Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: How do I avoid double substitution when replacing many patterns?

by japhy (Canon)
on Jan 20, 2007 at 18:18 UTC ( #595690=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How do I avoid double substitution when replacing many patterns?
in thread How do I avoid double substitution when replacing many patterns?

You could change

(?: | ( \( ) )
to
( \( )?
... unless you get queasy when you see quantifiers placed on capturing groups.

Jeff japhy Pinyan, P.L., P.M., P.O.D, X.S.: Perl, regex, and perl hacker
How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart


Comment on Re^3: How do I avoid double substitution when replacing many patterns?
Select or Download Code
Re^4: How do I avoid double substitution when replacing many patterns?
by diotalevi (Canon) on Jan 20, 2007 at 19:02 UTC

    I thought about it but decided I wasn't sure whether that would work correctly with the later conditional. If it does, great.

    ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2015-07-02 06:40 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 (30 votes), past polls