For example, the following manifest(from https://kubernetes.github.io/ingress-nginx/examples/rewrite/), I know that any characters captured by (.*) will be assigned to the placeholder $2, which is then used as a parameter in the rewrite-target annotation, but why it is $2, not $1 and $3? I can't find anything explaining the difference on the Internet.
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$2
name: rewrite
namespace: default
spec:
rules:
- host: rewrite.bar.com
http:
paths:
- backend:
serviceName: http-svc
servicePort: 80
path: /something(/|$)(.*)