fix the regexp to allow .*[]! in type names

so that template instances, arrays, pointers, and namespace qualifiers are recognized