Forum Discussion
Joel_Moses
Jun 08, 2012Nimbostratus
If the string is all digits, then the above command would return 1 (True). If not, it'd return 0 (False). You can use it like so:
set captured_value [getfield [HTTP::uri] "/" 4]
if { [string match [0-9] $captured_value] } {
log local0. "The URL path entry $captured_value is okay (all digits)."
} else {
log local0. "The URL path entry $captured_value is not okay (non-digit characters were found)."
}
Replace the log sections with your logic to do what you need with that part of the URI. Hope this helps!