How to use regex for path rule

I use this router rule, but it does not work any more

Host(`foo.com`) && (Path(`/{id:^[A-Za-z0-9]{6}$}`) || Path(`/error/404`)) && Method(`GET`) 

The /error/404 worked very well, but the path regex does not work.
But the regex itself is correct.

Perhaps you can use my solution (I am on Swarm-Mode, btw) - or even better: improve it!

working .replacepathregex. example: (via.middleware)

(info: I am fixing the instances / tenants to specific nodes - so when one customer is "playing stupid" it's only his node which is affected ... performed via constraint of the service, btw..)

---------------- eg :: start: with dummy-path: /pathtotenant --------

  labels:
    - "traefik.enable=true"

    - traefik.http.middlewares.serviceInstance_001-redirect-websecure.redirectscheme.scheme=https
    - traefik.http.routers.serviceInstance_001-web.middlewares=serviceInstance_001-redirect-websecure
 # ---------------   
    - "traefik.http.routers.serviceInstance_001-web.rule=Host(`domain.abc`) && PathPrefix(`/pathtotenant`)"
    - "traefik.http.routers.serviceInstance_001-web.middlewares=serviceInstance_001-replacepathregex, serviceInstance_001-redirectregex" # these are the both below!
    
    - "traefik.http.middlewares.serviceInstance_001-replacepathregex.replacepathregex.regex=^/pathtotenant/(.*)"
    - "traefik.http.middlewares.serviceInstance_001-replacepathregex.replacepathregex.replacement=/$$1"
    - "traefik.http.middlewares.serviceInstance_001-redirectregex.redirectregex.regex=^(.*)/pathtotenant$$"
    - "traefik.http.middlewares.serviceInstance_001-redirectregex.redirectregex.replacement=$$1/pathtotenant/"      
 # ---------------   
    - traefik.http.routers.serviceInstance_001-web.entrypoints=web
      
    - traefik.http.routers.serviceInstance_001-web.tls.certresolver=letsencrypt
    - traefik.http.routers.serviceInstance_001-web.tls=true
    - traefik.http.routers.serviceInstance_001-web.entrypoints=websecure
    - traefik.http.services.serviceInstance_001-web.loadbalancer.server.port=80

    - traefik.http.services.serviceInstance_001-web.loadbalancer.sticky=true
    - traefik.http.services.serviceInstance_001-web.loadbalancer.sticky.cookie.name=serviceInstance001cookie
   
 # ---

    - traefik.docker.network=cloud-public