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')