According to the documentation,
StringCases[{s1, s2, ...}, p]
returns
{StringCases[s1, p], StringCases[s2, p], ...}
but, oddly enough,
StringCases["string", {p1, p2, ...}]
returns the results which match any of the patterns $p_i$, which is essentially equivalent to
Union[{StringCases["string", p1], StringCases["string", p2], ...}]
Is there a way to modify StringCases["string", {p1, p2, ...}]
to return just
{StringCases["string", p1], StringCases["string", p2], ...}
in an analogous manner to how StringCases[{s1, s2, ...}, p]
does it?
One alternate way to get the same output would be
Through[Table[StringCases[#, p[i]] &, {i, n}]["string"]]
but I was curious if there was another way.
StringCases["string", #] & /@ {p1, p2}
$\endgroup$