The name Rahab in the Bible
There are two completely different names Rahab in the Old Testament that are both usually transliterated into the same name Rahab. We'll call them Rahab I (רחב) and Rahab II (רהב):
The name Rahab I in the Bible
The famous Rahab is really Rachab (with a ch as in Bach or Loch). This Rahab is a prostitute in Jericho. When Joshua sends two unnamed spies to Jericho to check out the town, their area of reconnaissance is confined mostly to the house of Rahab, who, we shall assume, also ran a youth hostel. When the townsfolk of Jericho pursue the men, Rahab hides them safely under flax on the roof. When Israel destroys the walls of Jericho, Rahab's house, now marked with a scarlet cord, remains intact and Rahab and her household are incorporated into Israel.
This Rahab is referred to in the New Testament by Paul (Hebrews 11:31) and by James (2:25), and both call her Ρααβ, which shows that the Hebrew ch-sound became a guttural stop sound in Greek: Ra'ab. This Greek version of Rahab is also the one employed by the Septuagint's version of the book of Joshua. The Vulgate reads the Latinized Raab.
But the Rahab who Matthew famously mentions in the genealogy of Jesus, as the mother of Boaz of Bethlehem (Matthew 1:5) is spelled Ραχαβ: Rachab. Most commentators will report that the Rahab in Christ's family line is the converted Rahab the prostitute of Jericho, but that is by no means certain because Matthew uses the other version of the name Rahab (what we call Rahab II: רהב). In English these names sound the same but in Hebrew and Greek they're as different as Johnny and Ronnie.
And if Rahab of Jericho had married someone important, such as Salmon, the great-grandfather of king David (Ruth 4:20), we would have surely heard about it at some point in the fifteen hundred years or so between Rahab of Jericho and Matthew. In Hebrews 11:31 Paul says that Rahab's faith kept her from perishing along with the rest of the disobedient townsfolk. If her survival would have given her the opportunity to become the ancestor of Jesus Christ, Paul would have likely made a note of that too. It seems that Matthew isn't talking about Rahab of Jericho but of an other, unknown Rahab.
Etymology of the name Rahab I
The name רחב (Rahab of Jericho) comes from the verb רחב (rahab), meaning to be wide or spacious:
Rahab I meaning
For a meaning of this name Rahab, NOBSE Study Bible Name List reads Violence for no discernible reason. Jones' Dictionary of Old Testament Proper Names reads Spacious.
The name Rahab II in the Bible
The lesser known Rahab, spelled רהב and indeed pronounced as Rahab, is a poetic nickname for Egypt, or rather the wisdom tradition of Egypt. It occurs in Psalm 87:4, Psalm 89:10, Isaiah 30:7 & 51:9 and Job 9:13 & 26:12. In the latter verses of Job and Isaiah, God cuts her to pieces and Isaiah equates her with the dragon (תנין, tanin) of old that was pierced.
The name רהב (Rahab the primeval serpent) comes from the verb רהב (rahab), meaning to behave proudly in the sense of arrogant:
HAW Theological Wordbook of the Old Testament and BDB Theological Dictionary both report an original meaning of storming against something or someone, which would fit the Biblical mythology of YHWH fighting Rahab and Leviathan; the Biblical answers to the Mesopotamian gods of chaos (as the Oxford Companion to the Bible calls them).
Rahab II meaning
For a meaning of this name Rahab, NOBSE Study Bible Name List reads Pride, Arrogance. Jones' Dictionary of Old Testament Proper Names reads Insolence.