A
A
Artem Andreev2018-04-09 19:52:54
JavaScript
Artem Andreev, 2018-04-09 19:52:54

How to do strict regex validation in js?

var regExp = (/^([0-9]+)([.]?)([0-9])\+|\-|\*|\/([0-9]+)([.]?)([0-9])\+|\-|\*|\//);

Can you please tell me how to make a strict check with this expression?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2018-04-10
@saboteur_kiev

let's say I enter 24 + 2 (but I want to enter 24 + 25) he immediately considers equal

In this case, your regular expression should look like
you just wrote a regular expression. You didn't even hint what exactly you want to limit. Start with a good problem statement.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question