Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2017-12-16 22:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (459 votes). Check out past polls.

    Notices?