Finding matches and groups of characters