Forum Discussion
Josh_Wu_12472
Nimbostratus
Jul 02, 2007syntax issue on 4.x to 9.x conversion
Hey guys. I've been doing some code conversion to a newer F5 box and ran into a compiling issue with a short code segment from the original.
----------------------------------------------------------------------------------
The original looks like:
if (http_uri matches_regex "/invoke/FxPartnerDriverStandard.Public[\:,\/]ProcessRqst" and http_header("SSLClientCertStatus") == "NoClientCert") {
use pool TMP_PROD_client_Auth_me_6555_pool
}
I've converted it to:
if {$uri matches_regex "/invoke/FxPartnerDriverStandard.Public[\:,\/]ProcessRqst" and $header == "NoClientCert"} {
pool TMP_PROD_client_Auth_me_6555_pool
}
Here's the problem.
[\:,\/] is the segment that won't compile. Just FYI, that code segments expanded basically means
$uri matches_regex "/invoke/FxPartnerDriverStandard.Public: ProcessRqst" (I made the space on purpose since it converts to a smiley if put together...)
or
$uri matches_regex "/invoke/FxPartnerDriverStandard.Public/ProcessRqst"
----------------------------------------------------------------------------------
I have solved the issue by doing an 'or' and just separated the two compares in the if statement. While that's fine, the code becomes long and ugly if we were to add additional symbols. Is there a similar way to do this comparison in 9.x iRule?
Thanks!!
- Colin_Walker_12Historic F5 AccountYou should be able to use the standard TCL "or" structure in the regex comparison. It would look like:
if {$uri matches_regex "/invoke/FxPartnerDriverStandard.Public(\:|\/)ProcessRqst" and $header == "NoClientCert"} { pool TMP_PROD_client_Auth_me_6555_pool }
- Josh_Wu_12472
Nimbostratus
I wasn't sure where to look for to get my answers so thanks a lot for the reply! Helped a lot in clarifying some syntax changes in 9.x
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