Filename syntax in search rules

This query name:~_1. is not 100% what you’re looking for but it shoud be ok in most cases. You could use this query with Script: Create or change smart group(s).