The resonant-state expansion (RSE), a rigorous perturbation theory of the Brillouin-Wigner type recently developed in electrodynamics[E. A. Muljarov, W. Langbein, and R. Zimmermann, Europhys. Lett. 92, 50010 (2010)], is applied to planar, effectively one-dimensional optical systems, such as layered dielectric slabs and Bragg reflector microcavities. It is demonstrated that the RSE converges with a power law in the basis size. Algorithms for error estimation and their reduction by extrapolation are presented and evaluated. Complex eigenfrequencies, electromagnetic fields, and the Green's function of a selection of optical systems are calculated, as well as the observable transmission spectra. In particular, we find that for a Bragg-mirror microcavity, which has sharp resonances in the spectrum, the transmission calculated using the RSE reproduces the result of the transfer- or scattering-matrix method.