Fixed some regex issues and file name validation

- Fixed an issue that caused attribute values to be converted to 1 on
  save in case of an empty regexp table

- Filename validation now happens via whitelisting instead of filename
  sanitization