Match a single string against a list of patterns