Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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. thor
Feel the white light, the light within In reply to Most specific pattern by thor
|
|