Я хочу проверить символы в нескольких позициях, используя регулярное выражение
Исходная строка может быть 6-4,4-6,6-4
Хотите проверить ниже
the char at position 0 should be [1-7]
the char at position 1 should be [-]
the char at position 2 should be [1-7]
the char at position 3 should be [,]
the char at position 4 should be [1-7]
the char at position 5 should be [-]
the char at position 6 should be [1-7]
the char at position 7 should be [,]
the char at position 8 should be [1-7]
the char at position 9 should be [-]
the char at position 10 should be [1-7]
Должен возвращать true, если выше совпадает, иначе false
Дайте мне знать, как я могу улучшить ниже, чтобы проверить несколько позиций и хороший справочник по регулярному выражению JavaScript
new RegExp("^.{0}[1-7]").test("6-4,4-4,6-4")