When creating a wildcard query you check for both ? and *.  Shouldn't you replace both here?