Summary1. Despite substantial recent progress, ecologists continue to search for methods of measuring the structure of ecological networks. Several studies have focused on nestedness, a pattern reflecting the tendency of network nodes to share interaction partners. Here, we introduce a new statistical procedure to measure both this kind of structure and the opposite one (i.e. species' tendency against sharing interacting partners) that we call 'node segregation'. In addition, our procedure provides also a straightforward measure of modularity, that is, the tendency of a network to be compartmented into separated clusters of interacting nodes. 2. This new analytical measure of network structure assesses the average deviation between the observed number of neighbours shared by any pair of nodes (species), and the expected number, that is computed using a probabilistic approach based on simple combinatorics. The measure can be applied to both bipartite networks (such as plant-pollinators) and unimode networks (such as food webs). We tested our approach on several sets of hypothetical and real-world networks. 3. We demonstrate that our approach makes it possible to identify different kinds of non-random network configurations (nestedness, node segregation and modularity). In addition, we show that nestedness in ecological networks is less common than previously thought, and that most ecological networks (including the majority of mutualistic ones) tend towards patterns of segregated associations. 4. Our analyses show that the new measure of node overlap and segregation can efficiently identify different structural patterns. The results of our analyses conducted on real networks highlight the need to carefully reconsider the assumption that ecological networks are stable due to their inherent nestedness.