Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 meditating upon the Monastery: (11)
As of 2014-10-23 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (129 votes), past polls