079
stringregex=“\\([\\d\\.\\+\\-\\*/]+\\)“;//提取括号表达式
080
string=string.replaceall(“\\s“,““);//去除空格
081
try{
082
patternpattern=patternpile(regex);
083
//循环计算所有括号里的表达式
084
while(pattern.matcher(string).find){
085
matcher=pattern.matcher(string);
086
while(matcher.find){
087
temp=matcher.group;
088
index=string.indexof(temp);
089