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

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

by choroba (Abbot)
on Nov 02, 2011 at 17:28 UTC ( #935453=note: print w/ replies, xml ) Need Help??


in reply to Re: 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

It does not work for nested parentheses:

$s='aa, aaa, aaaa, aaa, (aaa, aaa, aaa, a), aaa, aaa, (aaa, aaa, (aaa, + aa), aaa, aaa), aaa, aaa';
The specification is unclear in this regard.


Comment on Re^2: Substituting a comma only when it is preceded and followed by a bracket
Download Code
Re^3: Substituting a comma only when it is preceded and followed by a bracket
by BrowserUk (Pope) on Nov 02, 2011 at 17:39 UTC
    The specification is unclear in this regard.

    I think the specification is very clear and has all the appearance of being thorough. I took it to be so.

    Whilst is doesn't mention that there won't be nested parens, it also doesn't mention that the commas might one of the Unicode variants (eg.(U+060C)). Either would be a significant fact worthy of mention.

    For example, what would you do with commas inside the outer parens, but outside the inner ones?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2014-04-17 13:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (447 votes), past polls