B
B
Banan442020-04-29 10:48:58
JavaScript
Banan44, 2020-04-29 10:48:58

Problems with easy regex, why doesn't it work?

let string = 'astano214fs'
let pattern = new RegExp('^[a-zA-Z0-9]{8, }$')
alert(pattern.test(string))
// False

// Нужно проверить строку от 8 символов (Латинские буквы и цифры), мое регулярное выражение работает некорректно. Все из за {8, }, с + все работало, почему так?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-04-29
@Banan44

remove the space after the comma

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question