title: Removing special characters from string in LUA
body: <p>I'm trying to clean up a column of data containing postal codes before processing the values.  The data contains all kinds of crazy formatting or input like the following and is a CHAR datatype:</p>
  
  <p>12345
  12.345
  1234-5678
  12345 6789
  123456789
  12345-6789
  .
  [blank]</p>
  
  <p>I would like to remove all of the special characters and have tried the following code, but my script fails after many iterations of the logic.  When I say it fails, let's say sOriginalZip = '.', but it gets past my empty string check and nil check as if it is not empty even after I have replaced all special characters, control characters and space characters.  So my output looks like this:
  " 2 sZip5 = " </p>
  
  <p>code:</p>
  
  <pre><code>nNull = nil
  sZip5 = string.gsub(sOriginalZip,"%p","")
  sZip5 = string.gsub(sZip5,"%c","")
  sZip5 = string.gsub(sZip5,"%s","")
  print("sZip5 = " .. sZip5)
  if sZip5 ~= sBlank or tonumber(sZip5) ~= nNull then
      print(" 2 sZip5 = " .. sZip5)
  
  else
      print("3 sZip5 = " .. sZip5)
  
  end
  </code></pre>