I have a list of strings
list. I am trying to get rid of some elements that match string pattern
list /. x_ /; StringMatchQ[x, patt] -> Nothing
I get the result I want but I also get an error:
StringMatchQ::strse: String or list of strings expected at position 1 in StringMatchQ[List, patt].
This happens because
ReplaceAll also evaluates the condition on the Head of
list. How can I get the result I want but prevent the error?