Regularity for nonisotropic two-phase problems with Lipschitz free boundaries