Changing your matching order would probably be your best bet. Regular expressions can get expensive in processing times and efficiency loss.
I would suggest What Lies Beneath's suggestion. Using a
switch statement you can go from the more specific to the generic to prevent things from firing and causing problems.
You'll will probably need to follow up your pool decisions with a
return statement as well to prevent the next event from interfereing with the previous.
Try something like this:
when HTTP_REQUEST {
switch -glob [string tolower [HTTP::uri]] {
"/capitals*" { pool firstpool; return }
"/capital*" { pool secondpool; return }
"/caps*" { pool thirdpool; return }
"/california*" { pool fourthpool; return }
"/ca*" { pool fifthpool }
default { pool defaultpool }
}
}
Hope this helps.