JavaScript Regular Expression To Match X Digits Only
Can someone help my pea brain figure out why my simple regular expression is not working as I am expecting/wanting it to. I want to match a date format of MM/DD/YYYY with exactly 2
Solution 1:
need to specify start and end of string
/^\d{4}$/
Solution 2:
try this ^\d{1,2}\/\d{1,2}\/\d{4}$
Post a Comment for "JavaScript Regular Expression To Match X Digits Only"