For bot detection, here is a sample in CodeShare that shows how to detect a bot via the "User-Agent" http header.
http://devcentral.f5.com/wiki/default.aspx/iRules/ControllingBots.html
Click here
As for url patterns, the easiest way is to use a switch statement with file globbing (star based wildcards)
when HTTP_REQUEST {
switch -glob [HTTP::uri] {
"*foo.html" {
do something
}
"/path/*" {
do something else
}
"/dir1/*" -
"/dir2/*" -
"/dir3/*" {
do something if either of the above 3 match.
}
}
}
The basics here is that the URI is available with the HTTP::uri command in the HTTP_REQUEST event. You can assign that to a variable and do if/else statements, a switch statement (shown above), a match to a class list (as shown in the ControllingBots sample code).
Hope this helps...
-Joe