d*
means that it should match zero or more "d
" characters. So any string is a valid match. Try d+
instead!
In order to have support for wildcard patterns I would replace the wildcards with the RegEx equivalents. Like *
becomes .*
and ?
becomes .?
. Then your expression above becomes d.*