Forum Discussion
Andrea_Arquint
Nimbostratus
Aug 14, 2013match strings between delimiters
Hi
I do have an irule that contains:
if {$al_ctrl_parameter contains $switch_app_pool }
switch_aap_pool could contain myURI_A1 or myURI
al_ctrl_parameter could contain TEST=myURI_A1,myURI,...
uni
Altocumulus
Aug 15, 2013I assume you want different actions depending on which of these strings match. I would use a switchstatement and put the myURI test after all the ones which also contain that string:
switch -glob -- $al_ctrl_parameter {
"*myURI_A1*" { do stuff }
"*myURI_A2*" { do stuff }
"*myURI_A3*" { do stuff }
"*myURI*" { do stuff }
}
It is kind of inefficient though. If the test string is the whole $al_ctrl_parameter, you can remove the -glob and asterisks, and then it would not be dependent on the order.
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