[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] requesting quick help



On Thu, January 11, 2007 07:51, Jay Hannah wrote:
> (2) Given your filename list
>
> Org1_Org2.common
> Org1-Org2-Org3.A_unique
> Org1_Org2_Org3.common
> Org1_Org3.common
> Org2-Org1-Org3.B_unique
> Org2_Org3.common
> Org3-Org1-Org2.C_unique

Boy, those file names sure look like something that a deranged CompSci
teacher would come up with... ;)

>From the "RegExp Hell" that was needed to solve this, I kinda wonder if
there isn't a cleaner aproach.  In other examples, if file are being
produced by a real system, there is usually some sort of logic to their
names.  Based on that, a concise regular expression if..then..else will
normally suffice.

Getting back to the original (apparent) bug, just keep in mind that you
want to have the most specific matches first, then fall back to broader
and broader matches.  (i.e. if you match for /*/ first thing, then
everything else will be ignored...)

Dan

- - - -
"Wait for that wisest of all counselors, time." -- Pericles
"I do not fear computers, I fear the lack of them." -- Isaac Asimov