You can define a score like this: eliminate all meta characters from the glob (so fred/*.mac becomes fred/.mac), and use the number of characters in that resulting string as a (crude) measure for specificity.
If you don't want to assign scores, but just compare pairs of globs for which one is more specific, a topologic sort can help you to get them in order for comparison.
In reply to Re: Glob best match?
by moritz
in thread Glob best match?
by tlhackque
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |