<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>

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
cross site scripting
vulnerabilities.
That said, you could probably do something pretty simple as you describe most easily with a regular expression replacement.
For example
```
```
replace the pattern ==([^=]*)== with <h2>\1</h2>
```
```