Forum Discussion
Robert_47833
Jun 04, 2012Altostratus
use string command to match many digitals
hello,dear
my url is
http://www.cjj.com/sit/event/12312343214324/313131/temp
I 'd like to use string command to filter all non-digital uri
![string match {^/sit/event/...
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!
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