Sunan an-Nasa'i, Volume 1, Book 3, Hadith 390 (DarusSalam)

It was narrated that Hafsah said: "Umm 'Atiyah would never mention the Messenger of Allah without saying: 'May my father be ransomed for him.' I said: 'Did you hear the Messenger of Allah say such and such?' And she said: 'Yes, may my father be ransomed for him.' He said: 'Let the mature girls, virgins staying in seclusion, and menstruating woman go out and witness the good occasions and the supplications of the Muslims, but let the menstruating women keep away from the prayer place.'"

أَخْبَرَنَا عَمْرُو بْنُ زُرَارَةَ، قَالَ أَنْبَأَنَا إِسْمَاعِيلُ، عَنْ أَيُّوبَ، عَنْ حَفْصَةَ، قَالَتْ كَانَتْ أُمُّ عَطِيَّةَ لاَ تَذْكُرُ رَسُولَ اللَّهِ صلى الله عليه وسلم إِلاَّ قَالَتْ بِأَبَا ‏.‏ فَقُلْتُ أَسَمِعْتِ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ كَذَا وَكَذَا قَالَتْ نَعَمْ بِأَبَا قَالَ ‏ "‏ لِتَخْرُجِ الْعَوَاتِقُ وَذَوَاتُ الْخُدُورِ وَالْحُيَّضُ فَيَشْهَدْنَ الْخَيْرَ وَدَعْوَةَ الْمُسْلِمِينَ وَتَعْتَزِلِ الْحُيَّضُ الْمُصَلَّى ‏" ‏ ‏.‏

sunnah.com