I'm trying to find efficient algorithm for checking if string with wildcards contains given substring.

The parts of the string are separated with a "." character.

So for example I have


And I want to check for given strings, if they are substrings of string above, for example to match with those:

cd.qq <- "qq" is replacement for wildcard
d.qwe.ef <- "qwe" is replacement for wildcard

What is the best algorithm to use?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.