• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 530
  • Last Modified:

is this js statement: datePat = /^\d{1,2}/\d{1,2}/\d{4}$/ correct?

hello:

i'm using this pattern: var datePat = /^\d{1,2}/\d{1,2}/\d{4}$/
for test a date format. i want the date format like: 09/11/2008

but when i use: var datePat = /^\d{1,2}/\d{1,2}/\d{4}$/

it shows a syntax eror. it shows the 25 char is invalid. i also tried: var datePat = /^\d{1,2}\/\d{1,2}\/\d{4}$/   got the same error...

could someone help out about this? thanks so much!

 
0
lilyyan
Asked:
lilyyan
  • 2
2 Solutions
 
ASPSQLServerCOMCommented:
try
/^\d{1,2}\/\d{1,2}\/\d{4}$/;
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now