Here's the code that works and thrives, but attempts to add a regular expression do not lead to anything ...

router.get('/id', function(req, res, next) { var id = req.params.id; res.render('profile',{ title: 'Профиль' }); }); 

I try in the most different combinations, but only this one works ...

 router.get('/:id([0-9]{3,8})', function(...) 

Since the example is taken from the Internet. When I’m sailing something in the spirit:

 router.get('/:id(/./)', function(...) router.get('/:id/./', function(...) router.get('/:id/(.)/', function(...) 

None of these options work, why? How to insert a regular expression in this case?

  • What addresses need to be processed? - ReinRaus
  • @ReinRaus any letter or number from 3 to 10 characters - Bim Bam
  • Address is something else. Look in the window of your browser; the address, for example, is written on this page. - ReinRaus

0