Match d-M-Y with javascript regex how?
- by bakerjr
Hi, my date formatting in PHP is d-M-Y and I'm trying to match the dates with a javascript regex:
s.match(new RegExp(/^(\d{1,2})(\-)(\w{3})(\-)(\d{4})$/))
To be used with the jQuery plugin, tablesorter. The problem is it's not working and I'm wondering why not.
I tried removing the dashes in my date() formatting (d M Y) and tried the ff and it worked:
s.match(new RegExp(/^\d{1,2}[ ]\w{3}[ ]\d{4}$/));
My question is what is the correct regex if I'm using dashes on PHP's date() i.e. d-M-Y? Thanks!