The Biot-Savart law is a well-known and powerful theoretical tool used to calculate magnetic fields due to currents in magnetostatics. We extend the range of applicability and the formal structure of the Biot-Savart law to electrostatics by deriving a Biot-Savart-like law suitable for calculating electric fields. We show that, under certain circumstances, the traditional Dirichlet problem can be mapped onto a much simpler Biot-Savart-like problem. We find an integral expression for the electric field due to an arbitrarily shaped, planar region kept at a fixed electric potential, in an otherwise grounded plane. As a by-product we present a very simple formula to compute the field produced in the plane defined by such a region. We illustrate the usefulness of our approach by calculating the electric field produced by planar regions of a few nontrivial shapes.