Link to home
Start Free TrialLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

How to Split nested () praceket

Hi,

I want to Split String  
add(add(15,add(4,5)),5)

my result should be
add(4,5)
add(15,add(4,5))
add(add(15,add(4,5)),5)

how to do this ..? can any one give me some idea ?
Avatar of Sathish David  Kumar N
Sathish David Kumar N
Flag of India image

ASKER

Its dynamic input so it may be different more than one nest bracket
eg:
add(add(15,add(4,add(5,4))),5)

or
add(add(15,5),5) how to do that??please help me give some tips !!
ya . correct. here i mention my question clearly. thats why i created new one.

i created this pattern
(\\(([^()]*|\\([^()]*\\))*\\)) its show the brackets but not nested . can you help me on this cehj???????
I already have - the answer is the same as before
not only add will string it may verie length() . so depend upon on the add or length function only we decide its no or size

eg:
add(15,length(4,5)) output should be no(15)+size(4,5)
before split i need to find wich function it is? thats the pblm i am facing
ASKER CERTIFIED SOLUTION
Avatar of Nuno Rogado
Nuno Rogado
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Meanwhile I developed a recursive version of it, simpler and more effective, do you need it?