# Kong ingress controller and path based routing

**URL:** <https://discuss.konghq.com/t/kong-ingress-controller-and-path-based-routing/2956>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [March 7, 2019, 3:18pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-and-path-based-routing/2956 "2019-03-07T15:18:15Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)\
**Post date:** [March 22, 2019, 4:05pm UTC](https://discuss.konghq.com/t/kong-ingress-controller-and-path-based-routing/2956/6 "2019-03-22T16:05:16Z")

</div>

It turns out that [Ingress Spec](https://github.com/kubernetes/kubernetes/blob/7d75b73e1d72cef7a0f0e2804f8e0a582ccb6b61/staging/src/k8s.io/api/networking/v1beta1/types.go#L170-L178) supports the POSIX regular expression (as defined by IEEE Std 1003.1) and not PCRE, which is used by Kong.

This means that you can use only a subset of regular expressions that are valid POSIX regexes.

Since, it’s an ID that you are trying express, I imagine it would be possible for you to know which characters can be present in the ID?

The following Ingress is satisfied and works properly for me, and you can build up on top of it:

```auto
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-regex
spec:
  rules:
  - http:
      paths:
      - path: "/billing/[a-z1-3]+/details"
        backend:
          serviceName: http-svc
          servicePort: 80

```

Please note that I put the above content into a YAML file on disk and then apply that, to get around escape issues with shells.

Hope this helps!

---

_[View the full topic](https://discuss.konghq.com/t/kong-ingress-controller-and-path-based-routing/2956)._
