Commonly, if a noble died before his heir came of age, a regent would be appointed. However, what if the heir was still inside his mother? Would there still be a regency untill the fetus came of age or the heir had to be actually born? Are there any historic occurrences of this?
Sure could. For feudal-era inheritance of a posthumous child (meaning a child born to a deceased father) examples check out this [answer] (https://www.reddit.com/r/AskHistorians/comments/6ez9u8/if_a_childless_king_died_and_his_wife_was/) by u/sunagainstgold that is quite excellent and deals with royal accession/succession of posthumous children.
This remained a concept post feudalism and in Blackstone's Commentaries (1765) of the Common Law we find it was still the case in England and her colonies;
An infant in ventre sa mere, or in the mother’s womb, is supposed in law to be born for many purposes. It is capable of having a legacy, or a surrender of a copyhold estate, made to it. It may have a guardian assigned to it; and it is enabled to have an estate limited to its use, and to take afterwards by such limitation, as if it were then actually born.