Forum Discussion
jaked_150553
Nimbostratus
Sep 09, 2014using regex with if condition and ends_with
I have requirement to check the end of a uri and check for pattern in it and take decisions based on it. example urls would be like this -
http://example.com/test/folder/dir-test
http://example...
Eric_St__John
Employee
Sep 09, 2014You shouldn't need regex for the specific use case you outlined. The following will look at the HTTP path(No parameters), to match against a path that ends with "-test".
when HTTP_REQUEST {
if { [HTTP::path] ends_with "-test" } {
do something
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects