In case someone doesn't know, the standard function for that is called fnmatch:
https://man7.org/linux/man-pages/man3/fnmatch.3.html