The magnetic fields of active regions