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...
nitass
Nov 22, 2011Employee
i'm not quite familiar with glob or regex. hope there is another which is better than this one. 🙂
[root@ve1023:Active] config b rule myrule list
rule myrule {
when RULE_INIT {
log local0. "\[string match \[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] 123456\]: [string match \[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] 123456]"
log local0. "\[string match \[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] abcdef\]: [string match \[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\] abcdef]"
}
}
[root@ve1023:Active] config cat /var/log/ltm
Nov 22 01:14:32 local/ve1023 err mcpd[23057]: 01020066:3: The requested rule (myrule) already exists in partition Common.
Nov 22 01:14:32 local/tmm info tmm[24220]: Rule myrule : [string match [0-9][0-9][0-9][0-9][0-9][0-9] 123456]: 1
Nov 22 01:14:32 local/tmm info tmm[24220]: Rule myrule : [string match [0-9][0-9][0-9][0-9][0-9][0-9] abcdef]: 0
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