Precise spatial control over the electrical properties of thin films is the key capability enabling the production of modern integrated circuitry. Although recent advances in chemical vapour deposition methods have enabled the large-scale production of both intrinsic and doped graphene, as well as hexagonal boron nitride (h-BN), controlled fabrication of lateral heterostructures in these truly atomically thin systems has not been achieved. Graphene/h-BN interfaces are of particular interest, because it is known that areas of different atomic compositions may coexist within continuous atomically thin films and that, with proper control, the bandgap and magnetic properties can be precisely engineered. However, previously reported approaches for controlling these interfaces have fundamental limitations and cannot be easily integrated with conventional lithography. Here we report a versatile and scalable process, which we call 'patterned regrowth', that allows for the spatially controlled synthesis of lateral junctions between electrically conductive graphene and insulating h-BN, as well as between intrinsic and substitutionally doped graphene. We demonstrate that the resulting films form mechanically continuous sheets across these heterojunctions. Conductance measurements confirm laterally insulating behaviour for h-BN regions, while the electrical behaviour of both doped and undoped graphene sheets maintain excellent properties, with low sheet resistances and high carrier mobilities. Our results represent an important step towards developing atomically thin integrated circuitry and enable the fabrication of electrically isolated active and passive elements embedded in continuous, one-atom-thick sheets, which could be manipulated and stacked to form complex devices at the ultimate thickness limit.