Forum Discussion
Robert_47833
Altostratus
Nov 22, 2011how 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?
hoolio
Cirrostratus
Nov 22, 2011Hi 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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
