Forum Discussion

gerald_wegener_'s avatar
gerald_wegener_
Icon for Nimbostratus rankNimbostratus
Jul 11, 2005

Regsub always returns a 1 never 0

I've tried running the script that is posted which uses regsub to search for Social Security Numbers in the form xxx-xx-xxxx. I've tried several different permuations of this but can never get anything but a value of "1" for $new_response1.

Click here to see the link to the iRule:

http://devcentral.f5.com/Default.aspx?TabID=29&newsType=ArticleView&articleId=25

The line in the last section:

 
 if {$new_response1 !=0} { 
     then replace content... 
 } 
 

Always returns a value of 1, even if there is no SSN found. I'm guessing that someone used != 0 to get it to work since it is never set to 0. i.e. if no SS is found.