You can switch with the whole URL, use something like this instead;
when HTTP_REQUEST {
set clienturl [string tolower [HTTP::host]][string tolower [HTTP::uri]]
switch -glob $clienturl {
"*/application1*" { pool poolname member ip port }
"*application2*" { pool poolname member ip port }
default { pool some-pool-name }
}
}
I can rewrite the rule for that number no problem and I might have suggested a Data Group if there were a great number of URLs but 12 should be manageable, I might do it anyway as it reduces the risk of errors when updating the URLs.
A regex would be far more CPU intensive.
Before I do the final rewrite, can I just check, are all 12 URLs going to the same member?