Vernier spectroscopy is a frequency comb-based technique employing optical cavities for filtering of the comb and for enhancement of the interaction length with the sample. Depending on the ratio of the cavity free spectral range and the comb repetition rate, the cavity transmits either widely spaced individual comb lines (comb-resolved Vernier spectroscopy) or groups of comb lines, called Vernier orders (continuous-filtering Vernier spectroscopy, CF-VS). The cavity filtering enables the use of low-resolution spectrometers to resolve the individual comb lines or Vernier orders. Vernier spectroscopy has been implemented using various near- and mid-infrared comb sources for applications ranging from trace gas detection to precision spectroscopy. Here, we present the principles of the technique and provide a review of previous demonstrations of comb-resolved and continuous-filtering Vernier spectroscopy. We also demonstrate two new implementations of CF-VS: one in the mid-infrared, based on a difference frequency generation comb source, with a new and more robust detection system design, and the other in the near-infrared, based on a Ti:sapphire laser, reaching high sensitivity and the fundamental resolution limit of the technique.