String match unexpected behavior
Hello all! I'm trying to implement string match for the following condition and am not coming up with the right combination of options and looking at tcl wiki didn't yield anything yet. In one irule (traffic_split), I setup a pattern and in my final irule (pool_mapping) I check for this test condition and override if it is met. The following works (I know its not exactly regex)
excerpt from traffic_split:
set test_host "www.fool.com"
set test_path_regex "\/investing\/general\/2016\/*"
set test_percentage 10
excerpt from pool_mapping:
if {[info exists test_cookie_name]}{
if {[HTTP::cookie exists $test_cookie_name] && $host equals $test_host && [string match -nocase $test_path_regex $path] }{
if { [HTTP::cookie value $test_cookie_name] <= $test_percentage }{
set tmfpool $test_pool
}
}
}
So, when requesting this URL, it works: http://www.fool.com/investing/general/2016/02/09/the-agony-of-high-returns.aspx
However, the developers of the application noted that there was some errant traffic being sent to them, example: http://www.fool.com/investing/general/2016/02/09/atom.xml
So, I thought just using something like one of the following, none of which worked:
set test_path_regex "\/investing\/general\/2016\/*\.aspx"
set test_path_regex "\/investing\/general\/2016\/.*\.aspx"
set test_path_regex "\/investing\/general\/2016\/*\.aspx$"
set test_path_regex "\/investing\/general\/2016\/.*\.aspx$"
Am I missing something, unimplemented by design, or something else entirely?