Is there a way to count characters based on custom filters?