views:

289

answers:

2

Hi

I have the following .ini configuration working fine for positive integers, but not negative integers.

routes.nd.type = "Zend_Controller_Router_Route_Regex"
routes.nd.route = "news/(\d+)/d"
routes.nd.defaults.controller = "news"
routes.nd.defaults.action = "display"
routes.nd.map.id = 1

How to make it detect negative integers? Apparently \d+ ignores negative numbers.

Can't find this in ZF docs.

regards

+2  A: 
Negative values:
"news/(-\d+)/d"
soulmerge
Great! Many thanks!
uuɐɯǝʃǝs
+1  A: 

Postitive or Negative values:

"news/(-?\d+)/d"
gnarf