Allah, the Exalted, has said:
٣١٧ - باب العفو عن لغو اليمين وأنه لا كفارة فيه، وهو ما يجري على اللسان بغير قصد اليمين كقوله على العادة: لا والله، وبلى والله، ونحو ذلك
Allah, the Exalted, has said:
Allāh will not impose blame upon you for what is meaningless1 in your oaths, but He will impose blame upon you for [breaking] what you intended of oaths. So its expiation2 is the feeding of ten needy people from the average of that which you feed your [own] families or clothing them or the freeing of a slave. But whoever cannot find [or afford it] - then a fast of three days [is required]. That is the expiation for oaths when you have sworn. But guard your oaths.3 Thus does Allāh make clear to you His verses [i.e., revealed law] that you may be grateful.
From ʿAʾishah (may Allah be pleased with her), who said: This verse — "Allah will not take you to task for what is unintentional in your oaths" — was revealed concerning a man's saying: "No, by Allah," and "Yes indeed, by Allah." Narrated by al-Bukhari.