add wildcard feature
fix edge case where foo[*] is given