allow the use of wildcards in inputs

This implementation works but can be slow when more than one wildcard
is used.