  Let $G$ be a simple graph and let $\nu(G)$ be the matching number of $G$. It
is well-known that $\reg I(G) \leqslant \nu(G)+1$. In this paper we show that
$\reg I(G) = \nu(G)+1$ if and only if every connected component of $G$ is
either a pentagon or a Cameron-Walker graph.
