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

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -