Metric for measuring wildcards in patterns