Forum Discussion
The_Bhattman
Feb 28, 2008Nimbostratus
Yes there are things you can use to match a pattern
* Matches any sequence of characters in string, including a null string.
? Matches any single character in string.
[chars] Matches any character in the set given by chars. If a sequence of the form x-y appears in chars, then any character between x and y, inclusive, will match. When used with -nocase, the end points of the range are converted to lower case first. Whereas {[A-z]} matches '_' when matching case-sensitively ('_' falls between the 'Z' and 'a'), with -nocase this is considered like {[A-Za-z]} (and probably what was meant in the first place).
Here is a small example of that.
when HTTP_REQUEST {
switch -glob [HTTP::URI] {
"portal.innovation.net" {
switch [HTTP::uri] {
"/" { HTTP::redirect "https://[HTTP::host]/PortalWAR/appmanager/portal/home" }
"/blah/blah*" { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]" }
"*blah" { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]" }
"blah*" { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]" }
"b?ah" { HTTP::redirect "https://[HTTP::host]/[HTTP::uri]" }
}
}
}
}