Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 cooling their heels in the Monastery: (11)
As of 2014-08-29 22:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls