Hello esteemed monks,
In reading a document internal to our company, it mentions something about a process that determines the best fit for something based on how it matches a pattern. This process basically has a config file that has a bunch of regexes, and for each regex, an action. Items are passed to the process, and it determines the "best fit" and executes that action associated with it. However, in reading the documentation, it seems that the metric that they use for "best fit" is the pattern with the fewest wildcard characters. It got me to thinking. The pattern "*" has only one wildcard character, but is the most general regex of all. However, by the aforementioned notion of "best fit", it could certainly qualify as the most specific pattern. My question to you is: can you think of a better metric? This is more of a thought experiment for me than anything.
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
: Just to be clear...I had shell wildcards on the brain when I wrote that '*' was the most liberal regex. Of course I meant '.*'. I'm leaving it as is so as not to orphan those kind enough to respond so far.