My models use beforeSave to sanitize and trim data. But I also use the model validation and some regex validations require that the values have no spaces.
Trim is used to remove unwanted spaces but beforeSave runs after the validation so the regex fails before trim.
How can I trim/escape/sanitize values before the validation?