javascript - how to write the regular expression to allow dashes in the date -


i write regular expression below

var validformat = /\d\d?[\-\/]\d\d?[\-\/](19\d\d|200\d)$/ 

it wont take dates : 08-12-2008 08/12/2008 works. what's problem?

you presumably had trailing whitespace @ end broke $ field. otherwise regex written fine.

paste code proving actual string date "08-12-2008" did not match...

remove $ , verify matched. proves it's $.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -