We can use a modification of the answer here to do this.
lst = {{{x1, -1}, {{a1, 1}, {c1, d1}}},
{{x2, 1 }, {{a2, -1}, {c2, d2}}},
{{x3, -1}, {{a3, 1}, {c3, d3}}},
{{x4, 1}, {{a4, -1}, {c4, d4}}}};
Extract[List@*First/@Position[a_/;a>=0][First/@lst]][lst]
{{{x2,1},{{a2,-1},{c2,d2}}},{{x4,1},{{a4,-1},{c4,d4}}}}
Or
Cases[{{x_,y_},{a__List}}:>{{x,y},{a}}/;y>=0][lst]
Same output.
If you need to only remove the {x,y}
pair, I would need to think about that.
Edit: I thought about it:
lst/.{{a_,b_?Negative},{c__List}}:>{{c}}
{{{{a1,1},{c1,d1}}},{{x2,1},{{a2,-1},{c2,d2}}},{{{a3,1},{c3,d3}}},{{x4,1},{{a4,-1},{c4,d4}}}}
This way loses the ordering, but it works with Cases
and shows a terrible way to pseudo-use multiple conditions:
Cases[{{x_,y_},{a__List}}:>Evaluate@#]&/@{Unevaluated[{{x,y},{a}}/;y>=0],Unevaluated[{{a}}/;y<0]}//#[lst]&/@#&
{{{{x2,1},{{a2,-1},{c2,d2}}},{{x4,1},{{a4,-1},{c4,d4}}}},{{{{a1,1},{c1,d1}}},{{{a3,1},{c3,d3}}}}}
DeleteCases
approach, I recommend using the level argument. e.g.DeleteCases[list, {_, b_} /; b < 0, Infinity]
$\endgroup$b<0
on symbol. $\endgroup$DeleteCases
method does work, perhaps your list structure used for this is not like how I definelst
in my answer? $\endgroup$