Re: Search Ambiguous

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • Re: SIGSEGV in getdir()
    ... just because you don't get a segmentation fault ... receiving a layer 7 acknowledge upon delivery of string. ... commenting out my pushfunction that pushes the logs onto my ... If you know what to look for valgrind can be very useful. ...
    (comp.unix.programmer)
  • Re: WebChange (was: First new application of 2009 - !SiteMap)
    ... the text matched by the first wildcard is ... The first wildcard would match "wibble">some ... within the 'context' - so a search is first performed for the context string ...
    (comp.sys.acorn.apps)
  • Re: Find and Replace
    ... Greg Maxey/Word MVP ... MarkN wrote: ... Again <s anchors the start of a find string to a word starting with ... that the limts a wildcard search to a word and not a string. ...
    (microsoft.public.word.docmanagement)
  • Re: Strings
    ... Baring regex, you can also achieve a like comparison with instring. ... can contain any collection of characters, ... A string is nothing more than an address in memory with a certain lenght. ... A wildcard has nothing to do with that. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: IN Predicate in UPDATE statement
    ... Dim strElement As String ... Dim strWildCard As String ... 'element ends in wildcard, ...
    (microsoft.public.access.queries)