Maseches Nedarim, chapter nine, mishnah two. The mishnah deals with the possibility of using Shabbos and Yom Tov as an "opening" for annulling a vow.
The text of the mishnah:
"Poschin b'yamim tovim u'v'Shabbasos" - one may use Yom Tov or Shabbos as an opening for a vow.
How so? A person made a vow that applies over a period of time that includes Shabbos or Yom Tov, for example:
He vowed to fast for a certain number of days.
He vowed not to eat meat for a certain period.
We ask him: had you known that Shabbos and Yom Tov would fall within that period, days on which you cannot fast or on which you are required to eat meat, would you have made the vow? And he answers: "No." That answer serves as an opening for the vow.
"Rishonah hayu omrim":
At first they said that when such an opening is used, "osan hayamim mutarin u'she'ar kol hayamim asurin" - only the days to which the opening applies, the Shabbosos and the Yamim Tovim, are permitted, while the remaining days stay forbidden, since for them no opening was found.
"Ad sheba Rabbi Akiva v'limed":
"Shehaneder shehutar miktzaso hutar kulo" - a vow of which part was annulled is entirely annulled. The reason: the intention of the one who vowed was that the vow take effect in a particular way and in its entirety, and once part of it has been uprooted it is no longer relevant.
The Yerushalmi finds a source for this in the verse: "kol hayotzei mipiv yaaseh" - this is the mitzvah to fulfill whatever a person has expressed with his mouth in his vow. But once part of the vow has been uprooted, there is no longer "all that comes out of his mouth," and therefore the entire vow is void.
In summary: in this mishnah we learned that Shabbos and Yom Tov serve as an opening for annulling a vow, since this is not what the one who vowed had in mind. At first they held that the annulment was limited to those days alone and the remaining days stayed forbidden, until Rabbi Akiva came and taught the rule "a vow of which part was annulled is entirely annulled," because the intention of the one who vowed was for a complete vow, as the Yerushalmi derived from the verse "kol hayotzei mipiv yaaseh."