In this paper, we determine regular black hole solutions using a very general f(R) theory, coupled to a non-linear electromagnetic field given by a Lagrangian $$\mathcal {L}_\mathrm{NED}$$. The functions f(R) and $$\mathcal {L}_\mathrm{NED}$$ are in principle left unspecified. Instead, the model is constructed through a choice of the mass function M(r) presented in the metric coefficients. Solutions which have a regular behaviour of the geometric invariants are found. These solutions have two horizons, the event horizon and the Cauchy horizon. All energy conditions are satisfied in the whole space-time, except the strong energy condition (SEC), which is violated near the Cauchy horizon. We present also a new theorem related to the energy co...