Bamidbar36:6

זֶה הַדָּבָר אֲשֶׁר־צִוָּה יְהוָה לִבְנוֹת צְלָפְחָד לֵאמֹר לַטּוֹב בְּעֵינֵיהֶם תִּהְיֶינָה לְנָשִׁים אַךְ לְמִשְׁפַּחַת מַטֵּה אֲבִיהֶם תִּהְיֶינָה לְנָשִׁים׃

This is the thing which the Eternal commanded concerning the daughters of Tzelofchad, saying: Let them be wives to whom they think best, only within the family of the tribe of their father shall they be wives.

Bamidbar 36:6

זֶה הַדָּבָר אֲשֶׁר־צִוָּה

Bamidbar / Numbers 36:6 · Drash

Bamidbar 36:6

זֶה הַדָּבָר אֲשֶׁר־צִוָּה יְהוָה לִבְנוֹת צְלָפְחָד לֵאמֹר לַטּוֹב בְּעֵינֵיהֶם תִּהְיֶינָה לְנָשִׁים אַךְ לְמִשְׁפַּחַת מַטֵּה אֲבִיהֶם תִּהְיֶינָה לְנָשִׁים׃

This is the thing which the Eternal commanded concerning the daughters of Tzelofchad, saying: Let them be wives to whom they think best, only within the family of the tribe of their father shall they be wives.

Drash דְּרָשׁ

The fifteenth of Av

The Talmud calls the fifteenth of Av one of the happiest days of Israel and explains it with this verse: on that day the tribes were permitted to marry one another.

Talmud (Taanit): Israel had no good days like the fifteenth of Av and Yom Kippur. The fifteenth of Av is the day the tribes were permitted to marry into one another: "this is the thing which the Eternal commanded concerning the daughters of Tzelofchad (Zelophehad)" applied only to that generation. Also on that day the tribe of Binyamin (Benjamin) was permitted to enter the congregation, and the dying of the wilderness generation came to an end. Midrash Aggadah: the Eternal gave the daughters advice: if they want to marry worthy men of their father's tribe, let them not marry others.

How Ein Yaakov and Midrash Aggadah explain it

Ein Yaakov This is the thing which the Eternal commanded concerning the daughters of Tzelofchad

[Mishnah: Rabban Shimon ben Gamliel said: Israel had no good days like the fifteenth of Av and Yom Kippur, and so on.] Yom Kippur is understood: a day of forgiveness and pardon, the day on which the last tablets were given to Israel. But the fifteenth of Av, what is it? Rav Yehudah said in the name of Shmuel: the day on which the tribes were permitted to marry into one another. How did they expound it? "This is the thing which the Eternal commanded concerning the daughters of Tzelofchad" and so on: this thing shall apply only in this generation. Rabbah bar bar Chanah said in the name of Rabbi Yochanan: the day on which the tribe of Binyamin (Benjamin) was permitted to enter the congregation, as it says: "And the men of Israel had sworn in Mitzpah, saying: none of us shall give his daughter to Binyamin as a wife" (Shoftim / Judges 21:1). How did they expound it? "Of us," and not of our sons. Rav Idi bar Avin said in the name of Rav Yosef: the day on which the dying of the wilderness generation ended. For the master said: until the dying of the wilderness generation ended, no word was addressed to Moshe (Moses), as it says: "When all the men of war had died out from among the people, the Eternal spoke to me, saying": to me the word was addressed.

Midrash Aggadah Only within the family of the tribe of their father shall they be wives

He gave them advice: if they want to marry worthy men of their father's tribe, let them not marry others.

Takeaway

The Mishnah (Taanit 4:8) says that on the fifteenth of Av and on Yom Kippur the daughters of Yerushalayim (Jerusalem) went out in borrowed white garments and danced in the vineyards.
The story of the tribe of Binyamin and the oath at Mitzpah is told in the book of Judges (21).
The words "When all the men of war had died out from among the people" are Devarim / Deuteronomy 2:16–17, while the edition of the Talmud points to Devarim / Deuteronomy 2:6.
The Babylonian Talmud gives the words about the day the dying of the wilderness generation ended in the name of other sages: Rabbah bar bar Chanah in the name of Rabbi Yochanan (Taanit 30b) and Rav Dimi bar Yosef in the name of Rav Nachman (Bava Batra 121a).