Forum Discussion

TMcGov_92811's avatar
TMcGov_92811
Icon for Nimbostratus rankNimbostratus
Mar 03, 2009

case insensitivity in 4.x IRule

My 9.4 iRule is as such and works great:

 

 

when HTTP_REQUEST {

 

if { [string tolower [HTTP::uri]] contains "myone/rf"} {

 

pool http-services.abc.com-zuma

 

}

 

else {

 

pool http-services.abc.com-unix

 

}

 

}

 

 

How do I update the 4.x iRule below to also be case sensitive ? It is a valid 4.x iRule without the case insensitivity....

 

 

if (http_uri matches_regex "CCCOne/RF") {

 

use pool services-zuma

 

}

 

else {

 

use pool services-unix

 

}

 

 

1 Reply

  • In 4.6 or so, the tolower function was added. If you are on 4.6+ you can use that. Else, you can use matches_regex and add both the upper and lowercase versions of each letter. You can check this post for examples (Click here)

     

     

    Aaron