Prevent some errors on Sqlite regex

This pull request prevents the following errors on SQLite regex lookups:
- failure if field value is None/null
- failure if field type is not a string based type