in reply to Re^3: search of a string in another string with 1 wildcard
in thread search of a string in another string with 1 wildcard

So if the length of my string to be searched is about 100 chars or more which is not a lot but I have a very large number of strings in which I want to search another substring (the same in all) like millions or may be more and more than 1 non-adjacent wildcard will be permitted, will it be efficient in terms of time and memory to use your code (of course it should be adapted for more than 1 non-adjacent wildcard) or String::Approx?

  • Comment on Re^4: search of a string in another string with 1 wildcard

Replies are listed 'Best First'.
Re^5: search of a string in another string with 1 wildcard
by roboticus (Chancellor) on Jul 27, 2014 at 16:59 UTC

    carolw:

    I don't really know about the efficiency, I was just trying to show a way that you can build the strings so the lengths don't unexpectedly change. You'll have to benchmark different ways if you want to find the most efficient.

    ...roboticus

    When your only tool is a hammer, all problems look like your thumb.