title: List matching records in PostregSQL
body: <p>I am working on search section where comparing input values with the stored records. Database having value like AB 09 C D 1234. I have explode (with space) input string to match with stored value but when I given input like AB09 CD 1234, it does not result above record. </p>
  
  <pre><code>SELECT * FROM some_vehicle WHERE vehicle_number ILIKE E\'%AB09 CD 1234%' 
  </code></pre>
  
  <p>vehicle_number in db: <code>AB 09 C D 1234</code><br>
  input string: <code>AB09 CD 1234</code></p>
  
  <p>I want to result having every possible scenario with combination of input string. Is there any way to do that in PostgreSQL?</p>
  
  <p>"replace" function able to eliminate blank space from the string. Is there any way in PostgreSQL to eliminate all special characters too along with blank space. I was trying different regular expressions like </p>
  
  <p>regexp_replace(vehicle_number,'[^a-z0-9\s]', '') and 
  regexp_replace(vehicle_number,'[(|-|)|\:|\@|#|\$|*|.|!|\,]', '') 
  but its not working.</p>
  
  <p>Thanks</p>
  
  <p>Figured it out after few attempts! was very close to it. "[^a-zA-Z0-9]" pattern eliminate all special characters including space with 'g' option as the fourth parameter of regexp_replace in PostgreSQL.</p>