Suppose I have the following edge list
edges = {N1003 -> N1003, N1003 -> N1099, N8911 -> N23122, N34019 -> N36051, N1019 -> N36001, N36019 -> N36043, N3405 -> N3423, N36291 -> N36004} I've tried various string argument to no avail. I'd like to extract just the edges in the above edgelist that contains the string N34 and N36. For example, I'm looking to just extract what would be the last 5 edges in the above edge list. The last 5 edges contain an N34 or an N36 in one end or both ends of the "a->"b" pair. Thoughts? Many thanks.
I've tried this ... it works ... but it is not efficient ...
Flatten[List[ Select[edges, And @@ {StringContainsQ[ToString@#[[1]], ""], StringContainsQ[ToString@#[[2]], "N36"]} &], Select[edges, And @@ {StringContainsQ[ToString@#[[1]], ""], StringContainsQ[ToString@#[[2]], "N34"]} &], Select[edges, And @@ {StringContainsQ[ToString@#[[1]], "34"], StringContainsQ[ToString@#[[2]], ""]} &], Select[edges, And @@ {StringContainsQ[ToString@#[[1]], "36"], StringContainsQ[ToString@#[[2]], ""]} &]]] 
