Answer the question
In order to leave comments, you need to log in
Why does JS match backtick in regular expression?
Good day.
There is the following regular expression:
/^[A-Yaa-yaёЁ]+[A-Yaa-yaёЁ\s\-'\d]+[A-Yaa-yaёЁ\-'\d]$/i
When checking it in the devtools console (Google Chrome) - "matches" a string with a reverse apostrophe (which is on the key with the letter "ё")
Here is the code:
let str = 'тест`ТЕСТ 123-45-54 654'
let regexp = /^[A-Яа-яёЁ]+[A-Яа-яёЁ\s\-'\d]+[A-Яа-яёЁ\-'\d]$/i
str.match(regexp)
Answer the question
In order to leave comments, you need to log in
[A-Z]
here the letter A is Latin, in the interval between Latin A and Russian I there are a lot of things. Check the letters.
Some kind of crap when using the range of capital letters A-Z in the list of characters. If it is not specified (and it does not need to be specified - after all, the i flag is specified), then everything works.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question