HTML Parsing - Convert a Text into a Link

Supposed that I have this text:\[quote\] Aaron was implicated in the sin of his brother at Meribah (Num. 20:8-13), and on that account was not permitted to enter the Promised Land. When the tribes arrived at Mount Hor, "in the edge of the land of Edom," at the command of God Moses led Aaron and his son Eleazar to the top of that mountain, in the sight of all the people. There he stripped Aaron of his priestly vestments, and put them upon Eleazar; and there Aaron died on the top of the mount, being 123 years old (Num. 20:23-29. Comp. Deut. 10:6; 32:50)\[/quote\]What I want to do is, to convert every bold text above into a link, and the link, if it is:
  • Num. 20:8-12, should be like: < a href="http://stackoverflow.com/questions/15696096/num20.8-12">Num. 20:8-13< /a>
  • Deut. 10:6; 32:50, should be like: < a href="http://stackoverflow.com/questions/15696096/deut10.6">Deut. 10:6< /a> < a href="http://stackoverflow.com/questions/15696096/deut32.50">Deut. 32:50< /a>
The structure of this text is like below:\[code\]<DIV> <B>Aaron</B> <SPAN> Aaron was implicated in the sin of his brother at Meribah (Num. 20:8-13), and on that account was not permitted to enter the Promised Land. When the tribes arrived at Mount Hor, "in the edge of the land of Edom," at the command of God Moses led Aaron and his son Eleazar to the top of that mountain, in the sight of all the people. There he stripped Aaron of his priestly vestments, and put them upon Eleazar; and there Aaron died on the top of the mount, being 123 years old (Num. 20:23-29. Comp. Deut. 10:6; 32:50) </SPAN></DIV>\[/code\]Any great ideas would be appreciated. Thanks :)
 
Back
Top