Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Substituting a comma only when it is preceded and followed by a bracket

by hbm (Hermit)
on Nov 02, 2011 at 18:03 UTC ( #935460=note: print w/ replies, xml ) Need Help??


in reply to Substituting a comma only when it is preceded and followed by a bracket

Another way (if parens aren't nested):

$s = 'blah blah, blah blah blah (blah, blah, blah), blah, blah'; $s =~ s#,(?=[^(]*\))#;#g; print $s; blah blah, blah blah blah (blah; blah; blah), blah, blah


Comment on Re: Substituting a comma only when it is preceded and followed by a bracket
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-10-25 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (145 votes), past polls