We present a fast algorithm to identify both regular and irregular orbits that map out a sustained shape in configuration space. The method, which we dub 'pattern autocorrelation' (PACO), detects a repeating pattern in time-series constructed from binary sign changes in phase-space coordinates reduced to two dimensions. This is achieved by computing the autocorrelation function of the time-series, and by retrieving a pattern and a pattern-to-signal ratio. We apply the method to two-dimensional orbits in the logarithmic potential in an application to spiral galaxies with an asymptotically flat rotation curve; the general case of three-dimensional orbits is sketched. We find that irregular orbits can yet sustain the smooth morphological features of a galaxy for a substantial fraction of a Hubble time: this fraction is quantified through the pattern-to-signal ratio. In the case where a central supermassive black hole is added to the potential, we find that up to ≈16% of initial conditions space yields irregular motion that may sustain long-lived regular features. The method further detects and distinguishes orbits that are not based on Lissajous theory of resonant motion. © 2013 Elsevier B.V. All rights reserved.