in reply to Re: qr() match order with multiple patterns
in thread qr() match order with multiple patterns

Thanks for your input. After some more thinking (and info from this thread) I did realize that I was looking at the match the wrong way and that it worked as you have stated here.

Essentially what I am attempting to do is create a date recognition engine. We process about 100,000 files a day with a large variety of naming conventions. Each name contains a date in one format or another. Unfortunately the programs that generate these file do not adhere to one date format or field delimeter.

I plan on adding a little more to it as rules. Such as the file date found can not be in the future, or too far in the past (1923). Since these files are handled many times by many programs the mtime or ctime are not reliable methods for dating the files.

Now that I have this part figured out and that it won't work as I had thought I might start another thread for suggestions on a date recognition engine.

I was able to make this work easily by placing the patterns into an array and then iterating through the array in order of preference and stopping when I reach a suitable fit.

  • Comment on Re: Re: qr() match order with multiple patterns