This weeks Regex Tuesday Challenge is to write part of a MarkDown parser - turn italic MarkDown (*this is italic*
) into HTML italic: <em>this is italic</em>
. It should not, however, match bold text - text surrounded by multiple asterisks.
This is a somewhat unrealistic challenge - in real life, you wouldn't have to make sure that it isn't bold, as you would have already parsed the bold text.
To test a regular expression on the test cases below, type it into the text input. Each test case will be marked as passed or failed respectively - you are aiming to get as many test cases as you can to pass. Note that JavaScript must be enabled for this feature to work. The regex engine used is the JavaScript regex engine; it is similar to PCRE, but with a few differences.