Forum Discussion

dp_119903's avatar
dp_119903
Icon for Cirrostratus rankCirrostratus
Nov 17, 2015
Solved

Help with RegEx

I am having some difficulty forming the correct syntax (or regex) for an irule.   I need to block some specific URI's if they come from a specific data group. The logic works, but the regex doesn...
  • Brad_Parker_139's avatar
    Nov 17, 2015

    regex in iRule equals bad news. Try something like this:

    elseif { [class match [IP::client_addr] equals block_ip] }{
        switch -glob [string tolower [HTTP::uri]] {
            "/user-experience*" { return }
            "/user*" -
            "/admin*" {
                reject
            }
            default { return }
        }
    }