Answer the question
In order to leave comments, you need to log in
How to correctly make a regular expression that finds numbers and arithmetic symbols?
Tried to search in different directories, but without success. I would be grateful to those who know.
Answer the question
In order to leave comments, you need to log in
It's not clear what exactly you need.
If individual characters, then [0-9\-+*/]
, if sequence (aka expression), then [0-9\-+*/]+
(but here with great care, because there may be spaces, and where there are spaces, there may be several expressions).
Well, if you need to parse an expression, taking into account the syntax and the presence of errors, then you won’t get by with a regular expression, then you need to write a full-fledged parser.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question