Genesis Ch. 38
27. Now it came to pass, at the time for giving birth, that behold, twins were in her womb.
28. And so it was, when she was giving birth, that the one put out his hand; and the midwife took a scarlet thread and bound it on his hand, saying, "This one came out first."
29. Then it happened, as he drew back his hand, that his brother came out unexpectedly; and she said, "How did you break through? This breach be upon you!" Therefore his name was called Perez.
30. Afterward his brother came out who had the scarlet thread on his hand. And his name was called Zerah.
Tamar married Judah, son of Jacob and Leah. (Judah was born in 1744 B.C..)