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?
hooleylist
Nov 22, 2011Cirrostratus
Hi Jucao,
(?i) sets case insensitive for the rest of the match:
http://www.regular-expressions.info/tcl.html
If you want to check the query string for a parameter of gsec being set to content, you could use URI::query:
if {[string tolower [URI::query [HTTP::uri] gsec]] eq "content"}{
In general, string operations will be 5-10 times more efficient than regexes.
Aaron
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