Techniques are developed to study the regular representation and
σ
\sigma
-regular representations of measure groupoids. Convolution, involution, a modular Hilbert algebra, and local and global versions of the regular representation are defined. The associated von Neumann algebras, each uniquely determined by the groupoid and the cocycle
σ
\sigma
, provide a generalization of the group-measure space construction. When the groupoid is principal and ergodic, these algebras are factors. Necessary and sufficient conditions for the
σ
\sigma
-regular representations of a principal ergodic groupoid to be of type I, II, or III are given, as well as a description of the flow of weights; these are independent of
σ
\sigma
. To treat nonergodic groupoids, an ergodic decomposition theorem is provided.