Fixed parenthesis - it looks like
This commit is contained in:
parent
0c807a8384
commit
fd2d489480
1 changed files with 1 additions and 1 deletions
|
@ -12,7 +12,7 @@ public class Calc {
|
|||
private static final Pattern ADD = Pattern.compile("([0-9\\.]+)\\+([0-9\\.]+)");
|
||||
private static final Pattern SUBTRACT = Pattern.compile("([0-9\\.]+)\\-([0-9\\.]+)");
|
||||
|
||||
private static final Pattern PARENTHESIS = Pattern.compile("\\((.+)\\)");
|
||||
private static final Pattern PARENTHESIS = Pattern.compile("\\(([^()]+)\\)");
|
||||
|
||||
public static Double calculate(String text) {
|
||||
StringBuffer buf = new StringBuffer(text);
|
||||
|
|
Loading…
Reference in a new issue