Luke 2
21 And when eight days were accomplished for the circumcising of the child, his name was called Jesus, which was so named of the angel before he was conceived in the womb.
22 And when the days of her purification according to the law of Moses were accomplished, they brought him to Jerusalem, to present him to the Lord;
23 (As it is written in the law of the Lord, Every male that openeth the womb shall be called holy to the Lord;)
24 And to offer a sacrifice according to that which is said in the law of the Lord, A pair of turtledoves, or two young pigeons.
25 And, behold, there was a man in Jerusalem, whose name was Simeon; and the same man was just and devout, waiting for the consolation of Israel: and the Holy Ghost was upon him.
26 And it was revealed unto him by the Holy Ghost, that he should not see death, before he had seen the Lord's Christ.
27 And he came by the Spirit into the temple: and when the parents brought in the child Jesus, to do for him after the custom of the law,
28 Then took he him up in his arms, and blessed God, and said,
29 Lord, now lettest thou thy servant depart in peace, according to thy word:
30 For mine eyes have seen thy salvation,
31 Which thou hast prepared before the face of all people;
32 A light to lighten the Gentiles, and the glory of thy people Israel.
33 And Joseph and his mother marvelled at those things which were spoken of him.
34 And Simeon blessed them, and said unto Mary his mother, Behold, this child is set for the fall and rising again of many in Israel; and for a sign which shall be spoken against;
35 (Yea, a sword shall pierce through thy own soul also,) that the thoughts of many hearts may be revealed.
36 And there was one Anna, a prophetess, the daughter of Phanuel, of the tribe of Aser: she was of a great age, and had lived with an husband seven years from her virginity;
37 And she was a widow of about fourscore and four years, which departed not from the temple, but served God with fastings and prayers night and day.
38 And she coming in that instant gave thanks likewise unto the Lord, and spake of him to all them that looked for redemption in Jerusalem.
39 And when they had performed all things according to the law of the Lord, they returned into Galilee, to their own city Nazareth.
******************************************************
(Please see the footnote for a comment about the phrase “eight days”. It is less important than other aspects of this passage in Luke.)
Luke 2:22 And when the days of her purification according to the law of Moses were accomplished, they brought him to Jerusalem, to present him to the Lord;
23 (As it is written in the law of the Lord, Every male that openeth the womb shall be called holy to the Lord;)
The quotation in Luke 23 is from Exodus 13:2.
Because of the unusual circumstances of the birth of Jesus - the way an angel had spoken to Mary before she conceived (Luke 1) the way an angel had spoken to Joseph about that miracle (Matt. 1:18-21) the remarks of Elizabeth (Luke 1:39-45) and the way Mary herself had been inspired on that occasion(Luke 1:46-55), it seems likely that Mary could have been thinking, as she presented her firstborn for dedication at the temple, of some of the promises of which she had read or that she had heard read in the synagogues:
Genesis 3:15 And I will put enmity between thee and the woman, and between thy seed and her seed; it shall bruise thy head, and thou shalt bruise his heel.
Deut. 18:15 The Lord thy God will raise up unto thee a Prophet from the midst of thee, of thy brethren, like unto me; unto him ye shall hearken;
This passage in Luke doesn’t include anything specific about how Mary and Joseph “marveled” at the words of Simeon but Simeon’s words “For mine eyes have seen thy salvation” must surely have reminded Mary and Joseph of what the angel had said to Joseph “...and thou shalt call his name Jesus: for he shall save his people from their sins.”
Simeon’s words “A light to lighten the Gentiles, and the glory of thy people Israel” are reminiscent of the prophecy of Isaiah:
Isaiah 9:2 The people that walked in darkness have seen a great light: they that dwell in the land of the shadow of death, upon them hath the light shined.
Isaiah 9:6 For unto us a child is born, unto us a son is given: and the government shall be upon his shoulder: and his name shall be called Wonderful, Counsellor, The mighty God, The everlasting Father, The Prince of Peace.
Footnote: If something happens on the first day of the week and again on the first day of the next week, most people in the modern era would say the second event occurred seven days after the first event. At the time of the birth of Jesus, however, most Hebrews were accustomed to using inclusive reckoning - i.e.most people were accustomed to including the first and the last of something such as days so that something occurring on the first day of the week and recurring on the first day of the next week was said to be an interval of eight days.
A vestige of inclusive reckoning is still with us in the way the notes of a musical scale are counted. This is easier to visualise on the keyboard of a piano. The root of the word “octave” is “eight”. Ask most people how many notes there are in a musical scale and they will answer “eight”. But that number “includes” the first note of the NEXT octave (ABCDEFG - A) which is why we use the word “inclusive” in the way we describe the numbering system of the ancient world.