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,...
Dan_Cox_24281
Nimbostratus
Aug 14, 2013Check out 'split' and 'lsearch' commands. https://devcentral.f5.com/articles/irules-101-15-tcl-list-handling-commands
if { [lsearch [split $al_ctrl_parameter ,] $switch_app_pool] } then {
do something
}
- Dan_Cox_24281Aug 14, 2013
Nimbostratus
If you want to exact string matches add the -exact parameter to lsearch otherwise it'll match partial strings - Dan_Cox_24281Aug 14, 2013
Nimbostratus
My bad, it should be: ~~~ if { [lsearch -exact [split $al_ctrl_parameter ,] $switch_app_pool] >= 0 } then { 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