0

attempting to match the following router

# GET /measurements/2013-10-10T16:20:00.000Z

Currently using this code:

var router = express.router();
router.get(/measurements\/:date(.*Z$), ResultCtrl.processRequest)

what am I missing here ?

runtimeZero
  • 26,466
  • 27
  • 73
  • 126

1 Answers1

1

Try

router.get('/measurements/:date(^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$)', ResultCtrl.processRequest)

That will match a timestamp of the form ####-##-##T##:##:##.###Z, where each # is a digit.

Nicholas
  • 486
  • 2
  • 7