Skip to content

Instantly share code, notes, and snippets.

@voronkovich
Created March 21, 2019 16:49
Show Gist options
  • Save voronkovich/1ec297cd7871624f6be51c13777b719e to your computer and use it in GitHub Desktop.
Save voronkovich/1ec297cd7871624f6be51c13777b719e to your computer and use it in GitHub Desktop.
Fuzzy match function in C
#include <ctype.h>
int fuzzy_match(const char *needle, const char *haystack)
{
while (*needle && *haystack) {
if (*haystack == tolower(*needle) || *haystack == toupper(*needle)) {
needle++;
}
haystack++;
}
return !*needle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment