Have the next regex /+|-^[(-]
, which I use in String.split(regex) method.
I want to split in situations when there is plus or minus, but if it's minus then don't split if before him there is opening parentheses.
Correct example: toDollar(-45euro)-$30 ----> { toDollar(-45euro) , $30 }
.
So my regex doesn't follow this rule, how to modify it ?