# HostRegexp, v3 and named regexp

**URL:** <https://community.traefik.io/t/hostregexp-v3-and-named-regexp/19802>\
**Category:** Traefik v3 (latest)\
**Tags:** docker\
**Created:** [September 12, 2023, 10:03pm UTC](https://community.traefik.io/t/hostregexp-v3-and-named-regexp/19802 "2023-09-12T22:03:58Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![sandroden](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/sandroden/32/1571_2.png) [@sandroden](https://community.traefik.io/u/sandroden)\
**Post date:** [September 12, 2023, 10:03pm UTC](https://community.traefik.io/t/hostregexp-v3-and-named-regexp/19802/1 "2023-09-12T22:03:58Z")

</div>

Hi,

I used to have a router used to redirect all traffic to https and used named regexp:

```auto
      - "traefik.http.routers.http-catchall.rule=HostRegexp(`{host:.+}`)"
      - "traefik.http.routers.http-catchall.entrypoints=web"
      - "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
      - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"

```

In v3 I had to use the simple regexp:

```auto
    - "traefik.http.routers.http-catchall.rule=HostRegexp(`.+`)"

```

that happens not to work on v2+.  
I noticed in the [migration docs](https://doc.traefik.io/traefik/master/migration/v2-to-v3/) that now these regexp must follow go syntax, but I thought that named regexp where [go regexp syntax](https://golang.org/pkg/regexp/syntax/) as well... since I'm not a golang savvy, I'd like to know when named regexp are needed and when they are not needed and not even usable.

TIA

---

_[View the full topic](https://community.traefik.io/t/hostregexp-v3-and-named-regexp/19802)._
