* @param str The expression string
* @return The expression parts
*/
public static String[] getExpressionsFromString(String str)
{
CharacterIterator ci = new StringCharacterIterator(str);
int braces = 0;
String text = "";
ArrayList exprList = new ArrayList();
while( ci.getIndex() != ci.getEndIndex() )
{
char c = ci.current();
if( c == ',' && braces == 0)
{
exprList.add(text);
text = "";
}
else if( c == '(' )
{
braces++;
text += c;
}
else if( c == ')' )
{
braces--;
text += c;
}
else
{
text += c;
}
ci.next();
}
exprList.add(text);
return (String[])exprList.toArray(new String[exprList.size()]);
}