Forum Discussion

Manu1's avatar
Manu1
Icon for Nimbostratus rankNimbostratus
Jan 03, 2020

Writing URI for caching in regex

Hello everyone.

Happy new year.

 

In the web acceleration profile we want to use caching wit a URI list.

We want to match these URIs:

/appsuite/api/apps/load/*

/appsuite/v=*

 

So i've put this in the Include List:

\/appsuite\/api\/apps\/load\/.+

\/appsuite\/v=.+

 

It does not work. I'm not an expert with regex and I don't have an equipment for testing.

Could you help me to write it right or give me a link to a regex writing book for Big-IP ?

 

Thanks

 

1 Reply

  • Your regex won't match either string if there is nothing after the last slash or the final = since you used .+ which matches one or more occurrences instead of .* which matches zero or more occurrences. If this is the desired behavior, I can't see anything wrong with your regex. I usually use .* to cover all possibilities though.

     

    According to https://support.f5.com/csp/article/K13814 Big-IP uses either Perl or RE2 regex libraries. You can search for regex testers that allow you to put in your regex and a test string to see if they match. This one even explains each part https://regex101.com/ and gives options to change the library (I think Golang uses RE2).

     

    It could also be that your regex is fine but there's some other configuration problem.

     

    Hope this helps, otherwise please post an example of a string that doesn't match if you have it.