Selecting elements from lists based on string pattern
lis = {{"abc", 1, 2}, {"cde", 3, 4}, {"fgbc", 5, 6}};
Using Cases
Cases[lis, {_?(StringTake[#, -2] == "bc" &), x_, y_} :> {x, y},
Infinity]
(* {{1, 2}, {5, 6}} *)
or
Rest /@ Cases[lis, {_?(StringTake[#, -2] == "bc" &), __}, Infinity]
(* {{1, 2}, {5, 6}} *)
Or using Select
Rest /@ Select[lis, StringTake[#[[1]], -2] == "bc" &]
(* {{1, 2}, {5, 6}} *)
Or using DeleteCases
Rest /@ DeleteCases[lis, {_?(StringTake[#, -2] != "bc" &), __},
Infinity]
(* {{1, 2}, {5, 6}} *)
Pick[lis[[All, 2 ;;]], StringEndsQ[lis[[All, 1]], "bc"]]
{{1, 2}, {5, 6}}
Also
f[{_String?(StringEndsQ["bc"]), x__}] := {x}
f[_] := Sequence[]
f /@ lis
{{1, 2}, {5, 6}}
This uses string matching on the first element of each sublist and then discards the first element from the matches.
lis = {{"abc", 1, 2}, {"cde", 3, 4}, {"fgbc", 5, 6}};
Rest/@Select[lis,StringMatchQ[First[#],RegularExpression["\\w*bc"]]&]
(* {{1, 2}, {5, 6}} *)
You may need to adjust the pattern given to RegularExpression
if your strings do not all begin with word characters.