Regex path match with multiple named capture groups does not work

hello,
I’m using kong open API gateway version 3.2.2 in dbless mode. I have the following configuration:

services:
  - name: status
    url: https://mockbin.org/bin/xxx
    plugins:
      - name: request-transformer
        config:
          replace:
            uri: /bin/xxx/orders$(uri_captures['groupTwo'])
    routes:
      - name: statuss
        paths:
          - ~/testpath(?P<groupOne>/services/(\S+))?/orders(/(?P<groupTwo>\S+))?
        strip_path: true
        preserve_host: false
        methods:
          - GET

But this is not working as expected. What i am getting in the upstream is just /bin/xxx/orders

Can someone please help ?