Dominik Adamski Dominik Adamski - 1 year ago 89
Java Question

Java regex aritmetic operators occurence

I have a little problem with regex in Java. I try make regex, which will be match aritmetic operations.
It is my regex:


It should accept string like 34+45*5^7/3-5, but it also accepts strings like 34+-/^34. I don't know what is wrong in this regex.

Sorry for my English.

Answer Source

Try this regex and let me know if there are any issues :-

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download