*this text is bold*,
_this text is italic_,
~this text is strikethrough~.
~_*this text is bold, italic and strike-through*_~
I want these text to be presented as,
<b>this text is bold</b>,
<i>this text is italic</i>,
<s>this text is strikethrough</s>.
<s><i><b>this text is bold, italic and strike-through</b></i></s>
I have tried this regex but It does not work for combination of symbols (*, _, ~).
text
.replace(/(?:*)(?:(?!s))((?:(?!*|n).)+)(?:*)/g, '<b>$1</b>')
.replace(/(?:_)(?:(?!s))((?:(?!n|_).)+)(?:_)/g, '<i>$1</i>')
.replace(/(?:~)(?:(?!s))((?:(?!n|~).)+)(?:~)/g, '<s>$1</s>');
Can I do this using regex?