Re: Search Ambiguous
- From: "Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 25 Aug 2008 09:53:37 +0100
The software I developed was for performing a regression-test of QA log
files. Some items in such logs (e.g. dates, times, SQL Identity values, etc)
will change without affecting the real test results. The software was
designed to compare such logs against a template (which used more
specialised wildcard markers than simply ?/#/*) and indicated whether
anything varied which was not expected to vary
The example I picked was off-the-cuff and not very representative Rick.
There were 3 wildcard characters in the pattern: *, #, and another *. These
matched, respectively, the 3 strings I showed.
However, a better example to demonstrate what I was talking about yesterday
would have a string of "xxxAyyyA2zzz" and a pattern of "*A#*". The only
difference now is that the digit follows the "A" rather than precedes it.
This means that you cannot do a non-recursive, left-to-right match because
the "A" in the pattern would then match the first "A" in the string (which
would be wrong) rather than the second "A" in the string.
The text fragments matching these wildcards would still be as in the
previous case
The algorithm is trying to find the "best match" of the whole template
string, and _all_ the wildcards within it. That's why I asked the OP whether
that was of any interest (I assumed it might be OTT). The example given here
is simply a contrived one to make a point
Tony Proctor
"Rick Rothstein (MVP - VB)" <rick.newsNO.SPAM@xxxxxxxxxxxxxxxxxx> wrote in
message news:uLNyCtcBJHA.3348@xxxxxxxxxxxxxxxxxxxxxxx
However, considering only "*" is easy. Consider a string of
"xxxAyyy2Azzz" and a pattern of "*#A*. This should return an array of:-
"xxxAyyy" and "2" and "zzz"
At first I thought I understood what you were doing, but now am so sure.
Why is the first and last substrings there at all? No part of them is
covered by the pattern, are they? Why is the second substring "2" only?
Assuming you are trying to find a minimum match of some kind, why wouldn't
it be "2A"? Or, if you are looking for just things that match the wildcard
(the # matching the "2"), then why aren't what match the asterisks being
reported? I'm afraid I am having trouble figuring out what the governing
"find rule" is.
Rick
.
- Follow-Ups:
- Re: Search Ambiguous
- From: Rick Rothstein \(MVP - VB\)
- Re: Search Ambiguous
- References:
- Re: Search Ambiguous
- From: Rick Rothstein \(MVP - VB\)
- Re: Search Ambiguous
- From: Tony Proctor
- Re: Search Ambiguous
- From: Rick Rothstein \(MVP - VB\)
- Re: Search Ambiguous
- From: Tony Proctor
- Re: Search Ambiguous
- From: Rick Rothstein \(MVP - VB\)
- Re: Search Ambiguous
- Prev by Date: Re: Move External Window
- Next by Date: Re: Move External Window
- Previous by thread: Re: Search Ambiguous
- Next by thread: Re: Search Ambiguous
- Index(es):
Relevant Pages
|