Forum Discussion
jay_41157
Nimbostratus
Sep 05, 2008wildcard in data group.
Hi ,
I am trying to use \apple\* --> * being wildcard... but i do not have the correct fromat.. in the data group. is there an escape squence ?
thanks
hoolio
Cirrostratus
Sep 05, 2008Does matchclass work with a * in the datagroup? I'm guessing not.
If not, you could either replace the class with a switch statement and use the glob flag for wildcard matching, or if you like the class, you could replace matchclass with a foreach loop:
when RULE_INIT {
Create a test class (actually a list in this case)
set ::test_class [list abcd abcde abcdef* abcdefg*]
foreach element $::test_class {
log local0. "Current \$element: $element"
if {[string match -nocase $element "ABCDEFG"]}{
log local0. "Matched \$element: $element. Exiting loop."
break
}
}
}
Log output:
Rule : Current $element: abcd
Rule : Current $element: abcde
Rule : Current $element: abcdef*
Rule : Matched $element: abcdef*. Exiting loop.
Aaron
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