kpiti_52215
Jan 29, 2013Nimbostratus
lsearch nocase bug or what?
I wanted to use case insensitive list search but I got an error back. Try this proof-of-concept iRule:
when CLIENT_ACCEPTED {
TCP::collect
}
when CLIENT_DATA {
set list [split [TCP::payload] foo]
if { [lsearch -all -nocase $list bar] >= 0 } {
log local0. "match"
}
}
What I get back is:
01070151:3: Rule [/Common/TestLsearch] error:
line 6: [invalid switch: "-nocase"] [-nocase]
Apart from TCL lsearch specs, this example is even mentioned in Colin's iRules guide Case Insensitive Comparisons
lsearch -all -nocase {a b c a b c} C
I'm running 11.1.0 for reference..
Is this a bug or is there some deeper reason for this?
Jure