  We consider the optimization problem of minimizing $\int_{\Omega}G(|\nabla
u|)+\lambda \chi_{\{u>0\}} dx$ in the class of functions $W^{1,G}(\Omega)$ with
$u-\phi_0\in W_0^{1,G}(\Omega)$, for a given $\phi_0\geq 0$ and bounded.
$W^{1,G}(\Omega)$ is the class of weakly differentiable functions with
$\int_\Omega G(|\nabla u|) dx<\infty$. The conditions on the function G allow
for a different behavior at 0 and at $\infty$. We prove that every solution u
is locally Lipschitz continuous, that they are solution to a free boundary
problem and that the free boundary, $\partial\{u>0\}\cap \Omega$, is a regular
surface. Also, we introduce the notion of weak solution to the free boundary
problem solved by the minimizers and prove the Lipschitz regularity of the weak
solutions and the $C^{1,\alpha}$ regularity of their free boundaries near
``flat'' free boundary points.
