This paper proposes a robust exponential control barrier function (RECBF) for systems affected by a class of mismatched disturbances, which forces system states to remain in a given safety set expressed by constraint functions. We consider the case that given constraint functions have different relative degrees for control input and disturbances due to the property of mismatched disturbances, and we extend a concept of the nominal exponential control barrier function (ECBF) to such cases. As a main result, we show RECBF conditions to guarantee invariance of the given safety set and formulate a convex optimization based controller with the RECBF conditions. In particular, we combine a disturbance estimation using Gaussian process regression, which is one of the machine learning methods, with the controller to make use of good properties of RECBF conditions. This formulation enables us to realize robust disturbance compensation based on experimental data, and it can be easily applied to practical systems. We show the effectiveness of the proposed controller through a numerical simulation of a magnetic ball levitation system having model uncertainty.