I have a function which looks like this:
bool ExpandWildCard(vector<string>& names, vector<string>& result, string& wildcard)
{
}
Here, I want to match the wildcard
with each element in the vector names
and if it does match, then add the element in names
to the result
vector.
Of course, if the wildcard is *, I could just add everything from names
to results
. Also I'm just trying to implement the *
wildcard for now.
How can I do this in C++?
One way I thought of doing this was using find()
algorithm but I am not sure I would match wildcards using that?