Page 1 of 1

regular expressions

Posted: Mon Sep 18, 2006 12:57 pm
by gr4v3
I have a string like "if(a > b,if(a > c,true,false),false)" and i want to parse it with regular expressions to work like a if...then..else procedure.
It's easy if i do with just "if(a > b,true,false)" but i want to support nested conditions but i cant get no solution =S besides im new to regular expressions =S

Any one knows how to do it ??? :)

Posted: Mon Sep 18, 2006 1:39 pm
by akimm
Use

Code: Select all

##code
##code

Posted: Mon Sep 18, 2006 2:57 pm
by feyd
Write a string parser. Regular expressions are not designed to handle nesting too well/easily.

Posted: Mon Sep 18, 2006 3:44 pm
by n00b Saibot
feyd wrote:Write a string parser.
presumably stack-based?