Forum Discussion
Using regex in policy rule condition
Hi,
I´m trying to convert an httpclass to a policy rule. As a condition I need a regular expression, i.e.conditions {
0 {
http-uri
values { '^/[0-9]{6}$' }
}
...
(example matches a uri containing of exactly 6 numeric characters).
I´ve looked up the documentation but didn´t find anything. AskF5 SOL14409 describes an approach which simply results in "contains" or "starts/ends_with" matching. And the approach above does not match. (Btw, fixed pattern matching is working fine.) Any ideas what I´m doing wrong, please? Thanks a lot in advance, Stephan2 Replies
- What_Lies_Bene1
Cirrostratus
Hey Stephan,
I didn't think anything other than the most simple regex's are supported with Policies, as per that SOL. I've not found anything else to make me think otherwise. Why do you think they would be?
- What_Lies_Bene1
Cirrostratus
Fair point, that certainly suggests extended regexs can be used. Like you, I can't find anything anywhere that actually specifically states what can or cannot be used. All examples are very basic.
Not sure if this is helpful: http://support.f5.com/kb/en-us/solutions/public/14000/900/sol14955.html - seems unlikely.
Clutching at straws, perhaps it has something to do with the quotes?
Also note others with the same problem: https://devcentral.f5.com/questions/ltm-114-traffic-policy-conditions-and-regular-expressions
Recent Discussions
Related Content
* 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