javascript - Match exacltly n numeric digits Regex -


i use regex match string of 2 characters, , both of characters have between 0 , 9.

example: if provide 12 - true , if provide 123- should give false.

i have tried below examples.

\d{6}$

^[0-9]{2}$

however, enter 123, giving true need false need two.

try regex

^\d\d$

test here https://www.regextester.com/1966


Comments

Popular posts from this blog

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -