I am try to write a regex to match conditional expressions, for example:
a!=2 1+2<4 f>=2+a
and I try to extract the operator. My current regex is ".+([!=<>]+).+"
But the problem is that the matcher is always trying to match the shortest string possible in the group.
For example, if the expression is a!=2, then group(1) is "=", not "!=" which is what I expect.
So how should I modify this regex to achieve my goal?