Similar to spark's second snippet of code, if you are looking only one directory level deep you can do the following:
when HTTP_REQUEST {
set HTTPtopdir [lindex [split [string tolower [HTTP::uri]] /] 1]
if {[class match $HTTPtopdir equals class_toserver1]}
{
pool server1
}
}
This takes URI "/xxx/yyy/zzz" and sets HTTPtopdir to just "xxx". It then does a class match against a class looking to match "xxx".
This would allow you to have a simpler class definition, such as:
class class_toserver1 {
{
"s"
"staff"
"tax"
}
}