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 06, 2012Nimbostratus
"string is digit" can include characters outside of the standard [0-9] in unicode if they are meant to represent numbers in other languages.
"string is integer" allows only numbers that can be recognized by the system as valid integers, with a couple of restrictions. From memory (and don't take my word on this, test it for yourself):
1) It'll see negative signed numbers as integers, so if you send it "-341343" and "454255" it'll say both are integers, which they are. But it's a case you probably want to check for if you think you may see a dash in that URI field.
2) It'll only see numbers that fit into a machine word, so you're limited to checking for numbers lower than 10000000000.
3) It will see integers in C-style 0x notation, so if your string begins with "0x" you may need to check for this.
But I don't think I'd use either for what you're doing. In the other thread, I explained about the use of "getfield". I'd use that syntax, and then do a [string match [0-9] $value_from_getfield] to test for whether it's all digits or not.
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