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/[0-9]*/[0-9]*/*} [HTTP::uri] ]
right?
* here only can represent digital when it is put after [0-9],right?
- Robert_47833Altostratusbesides thi ,"string is interge" and "string is digit"
- hooleylistCirrostratusHi Jucao,
- Robert_47833Altostratushello.,Aaron
- Joel_MosesNimbostratus"string is digit" can include characters outside of the standard [0-9] in unicode if they are meant to represent numbers in other languages.
- Robert_47833Altostratushello,Joel
- Joel_MosesNimbostratusIf 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)." }
- Robert_47833Altostratusoh,ok
- hooleylistCirrostratusReplied here:
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