How do I test whether a string would match a glob in Ruby? January 6, 2024 by Tarik Yes, it is possible using the fnmatch method: File.fnmatch("foo*", "food") #=> true