Haproxy path_reg compare number?

The paths are like this:

https://example.com/10001/5235723gdh.jpg

https://example.com/10007/836789370md.jpg

We want to extract the number and compare.

I tried with

    acl image1 path_reg \/[0-9]*\/.* le 10005
    acl image2 path_reg \/[0-9]*\/.* ge 10006

    use_backend image1 if image1
    use_backend image2 if image2

But it is not working. How can I make this working?

Thanks.

Cross posting, see mailing list:

https://www.mail-archive.com/haproxy@formilux.org/msg36608.html