A case of regularity of solutions to nonregular problems