Forum Discussion
Matt_Breedlove_
Nimbostratus
Aug 08, 2011assistance with literal question mark in switch
Hi All,
In this switch, it allows through a few URI prefixes with a wildcard, but then there is a URI that is like this
/?g
or like this
/?w
any single character following the literal ...
hoolio
Cirrostratus
Aug 30, 2011Michael, you were right. You need two backslashes to escape the question mark:
% switch -glob {/yz} {
"/ab*" -
/cd* -
"/\\??" { puts matched }
default { puts "no match" }
}
no match
%
% switch -glob {/?z} {
"/ab*" -
/cd* -
"/\\??" { puts matched }
default { puts "no match" }
}
matched
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