I'm sure someone already asked this question but I don't know what words to search for in google to find these answers.
I have to "translate" a text with markup to html (or rtf or xaml). The markup for "bold" is *. If I'd like the bold text to contain a literal * I have to mask it with a back slash.
So, the marked-up text...
This is *ju\*st* a test.
...should translate to "This is ju*st a test."
I'm looking for a regex pattern to get all the matches to "translate" to bold inside my marked-up text.
Right now I'm stuck with this one (a literal star followed by one or more characters that are not a star (as few as possible), followed by a literal star)
\*[^*]+?\*
But how can I enhance the "one or more characters that are not a star" part to don't stop at stars that are preceded with a backslash?
I want to use this regex in a .NET project, in case there are differences between the languages.