Forum Discussion

Robert_47833's avatar
Robert_47833
Icon for Altostratus rankAltostratus
Jun 11, 2012

how to check whether one pattern are all digits[0-9]

hi,

 

I tried your method

 

see,some case it doesn't work ,if it is :222xyz,it can exclude xyz222,but it conside 222xyz as all digits

 

really need your help this time

 

 

 

if { [scan [getfield [HTTP::uri] "/" 2] { %[0-9] } match ] == 1 } {

 

log local0. " [getfield [HTTP::uri] "/" 2] is ok" }

 

else {

 

log local0. " [getfield [HTTP::uri] "/" 2] is not ok"

 

}

 

 

 

Jun 10 11:37:34 slot3/tmm3 info tmm3[8092]: Rule srwd30-www : xyz222 is not ok

 

Jun 10 11:37:34 slot3/tmm3 info tmm3[8092]: Rule srwd30-www : xyz222 is not ok

 

Jun 10 11:37:42 slot3/tmm2 info tmm2[8091]: Rule srwd30-www : 222xyz is ok

 

Jun 10 11:37:42 slot3/tmm2 info tmm2[8091]: Rule srwd30-www : 222xyz is ok

 

 

 

what I want to is : check whether [getfield [HTTP::uri] "/" 2] is all digits [0-9]

 

 

thanks in advance

 

  • Hi Jucao,

     

     

    I replied to your other post here:

     

    https://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/2158816/showtab/groupforums/Default.aspx2264003

     

     

    Aaron