Answer the question
In order to leave comments, you need to log in
Regular expression getting number/fractional and negative?
Добрый день! Подскажите как получить числа из строк вида:
1
2+-1
2+(-1)
-2+-2
-2-2.1
результат ожидаю такой 1, 2, -1, 2, -1, -2, -2, -2, 2.1.
допер только до такого: [-]?[0-9]*[.,]?[0-9]+(?:[eE][-+]?[0-9]+)?
не могу сообразить как не брать минус если это знак выражения, я не знак отрицательного числа, например тут: -2-2.1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question