Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
regex = /^[0-9A-F]{2}:[0-9A-F]{2}$/ regex.test("2A:3G") // is resulting in false as output.
私が正しければそれは本当であるはずですか?
Gそうではない[0-9A-F]ので、それは真実ではないはずです。
G
[0-9A-F]
それが本当かどうかを確認できる/^[0-9A-F]{2}:[0-9A-F]{2}$/.test('2A:3F')ので、それが唯一の理由です。
/^[0-9A-F]{2}:[0-9A-F]{2}$/.test('2A:3F')