Y
Y
Yaroslav Ivanov2021-09-02 17:05:39
JavaScript
Yaroslav Ivanov, 2021-09-02 17:05:39

Is the regular expression correct?

Hey

// Регулярное выражение
/Invalid value. Expected: \d+\d, instead got: \d+\d.$/

// Строка
Invalid value. Expected: 12, instead got: 13.


Did I make it right? Everything is working. It is not clear why it does not work without the "$" sign (end of line)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2021-09-02
@space2pacman

/Invalid value\. Expected: \d+, instead got: \d+\./

dot must be escaped, otherwise it is interpreted as "any character".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question