<p>I'm building a website that requires very basic markup capabilities. I can't use any 3rd party plugins, so I just need a simple way to convert markup to HTML. I might have a total of 3 tags that I'll allow.</p>
<p>What is the best way to convert <code>==Heading==</code> to <code>&lt;h2&gt;Heading&lt;/h2&gt;</code>, or <code>--bold--</code> to <code>&lt;b&gt;bold&lt;/b&gt;</code>? Can this be done simply with Regex, or does somebody have a simple function?</p>
<p>I'm writing this in C#, but examples from other languages would probably work.</p>

[{'answer_id': 45998, 'author': 'Matt Sheppard', 'author_id': 797, 'author_profile': 'https://Stackoverflow.com/users/797', 'pm_score': 3, 'selected': True, 'text': '<p>It\'s not really a simple problem, because if you\'re going to display things back to the user, you\'ll need to also sanitise the input to ensure you don\'t create any <a href="http://en.wikipedia.org/wiki/Cross-site_scripting" rel="nofollow noreferrer">cross site scripting</a> vulnerabilities.</p>\n\n<p>That said, you could probably do something pretty simple as you describe most easily with a regular expression replacement.</p>\n\n<p>For example</p>\n\n<pre><code>replace the pattern ==([^=]*)== with &lt;h2&gt;\\1&lt;/h2&gt;\n</code></pre>\n'}, {'answer_id': 46006, 'author': 'pix0r', 'author_id': 72, 'author_profile': 'https://Stackoverflow.com/users/72', 'pm_score': 1, 'selected': False, 'text': "<p>This really depends on the Wiki syntax you're using as there are several different ones.  Obviously the wiki software has this functionality somewhere; if you can't find a software package that does this for you, you could start looking for the relevant code in your wiki software.</p>\n"}, {'answer_id': 20462306, 'author': 'wener', 'author_id': 1870054, 'author_profile': 'https://Stackoverflow.com/users/1870054', 'pm_score': 1, 'selected': False, 'text': '<p>Maybe <a href="http://www.mediawiki.org/wiki/Alternative_parsers" rel="nofollow">this</a> is what you need.</p>\n\n<blockquote>\n  <p>This page is a compilation of links, descriptions, and status reports of the various alternative MediaWiki parsers — that is, programs and projects, other than MediaWiki itself, which are able or intended to translate MediaWiki\'s text markup syntax into something else.</p>\n</blockquote>\n'}]
['https://Stackoverflow.com/questions/45991', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/681/']