# Error in route parameter that contains dot

**URL:** https://discourse.laminas.dev/t/error-in-route-parameter-that-contains-dot/1599
**Category:** Components & MVC
**Tags:** zend-mvc, zend-router
**Created:** [May 12, 2020, 5:55pm UTC](https://discourse.laminas.dev/t/error-in-route-parameter-that-contains-dot/1599 "2020-05-12T17:55:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![fgsl](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/fgsl/32/923_2.png) [@fgsl](https://discourse.laminas.dev/u/fgsl)
#### Post date: [May 12, 2020, 5:55pm UTC](https://discourse.laminas.dev/t/error-in-route-parameter-that-contains-dot/1599/1 "2020-05-12T17:55:36Z")

</div>

I have a module that queries data from a Kubernetes cluster. The pods have dots in their names, like “ldap-ndb-df-p.1”. I created a route of type **Segment** where there is a parameter _pod_. The router doesn’t match when pod name has a dot. Below it is the route definition. I have added a regex in constraints that matches a text with dot, but it doesn’t work.

```
'pod-route' => [
                'type' => Segment::class,
                'options' => [
                    'route' => '/cluster[/:action[/:namespace[/:pod]]]',
                    'constraints' => [
                        'pod' => '[a-zA-Z][a-zA-Z0-9_-]+[\.]+[a-zA-Z0-9_-]+'
                    ],
                    'defaults' => [
                        'controller' => Controller\IndexController::class,
                        'action' => 'index',
                    ],
                ],
            ],  

```

This route works only for parameters _action_ and _namespace_.  
I also have tried to use a route of type **Regex** , using the same expression in contraints above but it also doesn’t match.

I didn’t find in documentation about routing a guideline about exception treatment for routes. I need to know how I can express properly a route parameter with a dot, or how I can treat the exception, capturing the route unmatched and checking if it has a parameter pod with dot.

---

<div class="post-metadata">

### Author: ![tbuerli](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tbuerli/32/821_2.png) [@tbuerli](https://discourse.laminas.dev/u/tbuerli)
#### Post date: [June 9, 2020, 8:04am UTC](https://discourse.laminas.dev/t/error-in-route-parameter-that-contains-dot/1599/2 "2020-06-09T08:04:54Z")

</div>

Looks like I have a similar problem.  
Have you found a Solution to this problem, and if so would you mind posting it?

---

<div class="post-metadata">

### Author: ![fgsl](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/fgsl/32/923_2.png) [@fgsl](https://discourse.laminas.dev/u/fgsl)
#### Post date: [June 9, 2020, 12:55pm UTC](https://discourse.laminas.dev/t/error-in-route-parameter-that-contains-dot/1599/3 "2020-06-09T12:55:22Z")

</div>

No, I had to make a workaround with a listener, testing the route with ‘pod’ before matching. It’s like an alternative router, but really It is ugly.

---

<div class="post-metadata">

### Author: ![tbuerli](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.laminas.dev/tbuerli/32/821_2.png) [@tbuerli](https://discourse.laminas.dev/u/tbuerli)
#### Post date: [June 15, 2020, 4:01pm UTC](https://discourse.laminas.dev/t/error-in-route-parameter-that-contains-dot/1599/4 "2020-06-15T16:01:19Z")

</div>

I got it working.

Turns out my php test environment wasn’t setup quite correct.  
The 404 wasn’t from laminas.

php -t public/  
Ignores htaccess and web.config and returns 404 for files.

php public/index.php  
Works for files too.
