Forum Discussion

AlexDeMarco's avatar
AlexDeMarco
Icon for Nimbostratus rankNimbostratus
Dec 28, 2018

Case Insentive class matching?

I have a data group with mixed case entries: /MyWebService/ /MyOtherWebService/

 

When a user enters I want to be able to match it against the datagroup no matter what the case is. class match does not have a nocase function. Any ideas? or suggestions? Thank you! in advance...

 

1 Reply

  • Alex,

    Have you considered using 'string tolower' and changing the data group entries to lowercase? By just reading the URI as a lowercase word, you should be able to match properly regardless of case.

    when HTTP_REQUEST
    {
        if { class match [string tolower [HTTP::uri]] eq some_class }
        {
            Do something
        }
    }