Forum Discussion
Robert_47833
Altostratus
Aug 18, 2011how to match string1?string2?
there is a string start with /cjj?cjj2,how to match it?
if{
$uri matches_regex "^/cjj?cjj2"
}
{ persist none
HTTP::redirect "http://www.stubhub.com/404.html"
}
does "?" can be matched in matches_regex?
or do we have other method to achieve this?
3 Replies
- Kevin_Davies_40
Nacreous
if { $uri starts_with {/cjj?cjj2} } { { ... rest of code } }
Kevin (Jarvil) - Robert_47833
Altostratus
If I insist on using match_regex,
$uri match_regex "^/cjj?cjj2"
does it work? - Kevin_Davies_40
Nacreous
Sure if you put a \ in front of the ? otherwise it represents any non-whitespace character. Its worth noting that any regex matching is significantly slower that's why there are many alternatives.
Kevin (Jarvil)
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