How to: don't sync from specific subfolder based on a pattern

I have a problem with files that contain illegal filenames syncing to my android peer. I have a way to resolve them for any subdirectory of the parent root folder that is synced, expect a specific directory .trash.

How to prevent files that are in that folder and contain illegal filenames from syncing and not have failed items alerts?

Isn’t this the same issue as reported in syncing: no connected device has the required version of this file? I’d suggest to keep all information and discussion in the same topic for better context.