You can try something like below, for all the examples you given in your question below expression giving correct results
string input ="symptomsmedicine1";
string fromDb ="symptoms for medicine1";
if(fromDb.Split().Any(y=>input.Contains(y)))
{
}
you can compare strings after convert to lowercase or uppercase. then it will be a case insensitive search. :-)