Perhaps Thread[{_, _, #}]
applied to each tuple thus:
SeedRandom[1];
data = Table[RandomInteger[1, {RandomInteger[{2, 4}], 3}], {100}];
tuples = Table[RandomInteger[1, RandomInteger[{2, 4}]], {5}];
Application:
pos = Position[data, Thread[{_, _, #}]] & /@ tuples
(* {{{38}, {82}}, {{33}, {43}, {47}, {94}}, {{58}}, {{37}, {85}, {88}}, {}} *)
Check:
Grid[
MapThread[{Map[Last, Extract[data, #1], {2}], #2} &, {pos, tuples}],
Alignment -> Left]
(* {{1, 1, 0, 0}, {1, 1, 0, 0}} {1, 1, 0, 0}
{{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}} {1, 1, 1}
{{0, 0, 1, 0}} {0, 0, 1, 0}
{{1, 0, 0}, {1, 0, 0}, {1, 0, 0}} {1, 0, 0}
{} {0, 0, 1, 1}} *)
ToExpression[Table [StringJoin["{_,_,#[[",ToString[k],"]]}"],{k,1,n}]]
? You might want to add an&
at the end of your list. $\endgroup$n
. $\endgroup$n != Lenght@tuples[[_]]
. It can be fixed easily though $\endgroup$