MirtoBusico commented on issue #6387:
URL: https://github.com/apache/apisix/issues/6387#issuecomment-1046635565


   Thanks @tzssangglass as reported in your link the correct syntax is
   ```
   ^/pres/(.*)
   ```
   and the wrong syntax is
   ```
   ^/pres/(*)
   ```
   **Ok. The first syntax is the solution.**
   
   But I'm curious why the other syntax is wrong.
   If I understand correctly, if these regex:
   
   - (...) indicates something that will be passed as parameter (eg $1)
   - \* indicates 0 or more characters
   - . indicates 1 and only one character
   
   So, in my mind, ^/pres/(.\*) should match https://www.m01.net/pres/headers 
but don't match https://www.m01.net/pres/
   and ^/pres/(\*) should match both https://www.m01.net/pres/headers and 
https://www.m01.net/pres/
   
   But in my tests ^/pres/(.\*) matches both urls and I don't know why.
   
   
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to