Javascript Markup Parsing
Q: Using javascript, how would one turn this:
Some text in *bold font* and _in italic_.
into this:
Some text in bold font and in italic.
A: Regular Expression Extract and Replace
var sourceText = "Some text in *bold font* and _in italic_.";
var parsedHTML = sourceText.replace(/(\*([^*]+)\*)/g, "<b>$2</b>");
parsedHTML = parsedHTML.replace(/(_([^_]+)_)/g, "<i>$2</i>");



