Forum Discussion
Robert_47833
Nov 22, 2011Altostratus
how to understand this syntax "?" in matches_regex
if {$queryString matches_regex "(?i)gsec=content"} {
other code
}
I don't know the what "?" represent in this syntax
does it mean 0 or 1 single character?
nitass
Nov 22, 2011Employee
[root@ve1023:Active] config b rule myrule list
rule myrule {
when RULE_INIT {
set test "/test?param1=val1¶m2=val2"
log local0. "\[URI::query $test param1\]: [URI::query $test param1]"
log local0. "\[URI::query $test param2\]: [URI::query $test param2]"
switch [string tolower [URI::query $test param1]] {
"val1" { log local0. "val1" }
default { log local0. "default" }
}
}
}
[root@ve1023:Active] config tail /var/log/ltm
01:23:09 local/ve1023 err mcpd[23057]: 01020066:3: The requested rule (myrule) already exists in partition Common.
Nov 22 01:23:09 local/tmm info tmm[24220]: Rule myrule : [URI::query /test?param1=val1¶m2=val2 param1]: val1
Nov 22 01:23:09 local/tmm info tmm[24220]: Rule myrule : [URI::query /test?param1=val1¶m2=val2 param2]: val2
Nov 22 01:23:09 local/tmm info tmm[24220]: Rule myrule : val1
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