in reply to Most specific 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.

Are you sure the documentation is a correct description of what the code does? (Are you sure you are interpreting it correctly?)

When a given input is able to match two or more distinct regexes in a set (and the chosen action differs for each regex), then there are two ways to choose among the possible paths: