I have a list of strings. I need to accept a list of wildcard strings provided by the user, and return all matches (just need to support * operator). I know this can be done with Regex, i'm just afraid that it's overkill and will open me up to some potential malicious attacks.
From my searching i've found some VisualBasic stuff that does this, only it doesn't seem to be supported in core. I've also found that Directory.GetFiles() does this, only with an actual directory of files instead of just a list.
Is there some build in way of doing this? I just don't want to worry about reinventing the wheel and handling security.
EXAMPLES
files = ["foo\bar", "foo\foo", "bar\foo", "test"]
patterns = ["test", "foo\*"]
matches = ["foo\bar", "foo\foo", "test"]
I don't need any special operator except *