in reply to Re^2: Substituting a comma only when it is preceded and followed by a bracket
in thread Substituting a comma only when it is preceded and followed by a bracket
Does this help you?
s[ ( ## Capture \( ## from an open paren [^)]+ ## all non-close paren chars \) ## upto the close paren ) ][ ## assign the captured text ## to a local variable so that it can be edited ## and then replace all ,s with ;s ( my $x = $1 ) =~ tr[,][;]; ## and return the modified text to replace that captured. $x ] g ## globally e ## execute the replace as code x; ## extended notation to allow whitespace and comments
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Substituting a comma only when it is preceded and followed by a bracket
by locked_user sundialsvc4 (Abbot) on Nov 03, 2011 at 14:26 UTC | |
by BrowserUk (Patriarch) on Nov 03, 2011 at 18:12 UTC |