Forum Discussion
Robert_47833
Nov 22, 2011Altostratus
how to match 6 digtals via command except matches_regex
hi,dear irule
if {$uri matches_regex {-[0-9][0-9][0-9][0-9][0-9][0-9]}} {
pool xxx
}
I don't wanna use matches_regex any more
do u have an alternation method to achieve this?
thanks in advance.
- hooleylistCirrostratusSorry, I was mistakenly thinking scan would fail to match at all if the full string wasn't matched. You can use string is digit for this:
- hooleylistCirrostratusSo this should work for your scenario to check for a directory of all digits:
if { [string is digit [getfield [HTTP::uri] "/" 2]] } { log local0. " [getfield [HTTP::uri] "/" 2] is ok" } else { log local0. " [getfield [HTTP::uri] "/" 2] is not ok" }
- Robert_47833Altostratus-------------
- hooleylistCirrostratusYes, I wasn't too concerned about a URI containing non-ascii characters as HTTP URIs must contain only printable ASCII characters (and/or percent encodings of reserved characters). Here are a couple of references:
- Robert_47833Altostratusok,so in my case ,string is digit can work ,right?
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects