Re: get left and right characters
Quote:
True, something like 12+5+78 will not work, but that will be my next step i guess, to solve that kind of stuff. No idea how to do it right now though....
When you check your thread it's advisable to read all of the replies since your last post rather than just reading the reply at the end of the thread. If you had read all of the replies you would have seen that I posted twice and the first post showed you a way to do this.
Re: get left and right characters
Remember that the regex you specified to identify stuff between parentheses won't work in split(..) if you want what's between the parentheses - because split(..) uses the regex to specify the delimiter, so you'll get everything except what the regex specifies.
Using Pattern and Matcher is the way to go if you want to extract the stuff matched by the regex.
Note that if you are trying to construct some kind of expression evaluator (all your regex's seem to concern math expressions), using regular expressions is not the way to go. For this sort of thing, you need an expression parser. This is a well-explored area, and one where you'll find plenty of help online.
Vague and nebulous is the beginning of all things, but not their end...
K. Gibran