I have incorporated the following regular expression into my code:
.gsub(/(^|[^*])(\*\*)([^*]+)(\*\*)($|[^*])/m, '\1*\3*\5') # bold
The issue I'm facing is that the \3 block (defined as [^*]+) doesn't currently permit asterisks * within the text.
My objective is to modify the regular expression in such a way that it allows asterisks only if they are preceded by an escape character \. What is the appropriate approach to achieve this modification?
Examples: **hello \* world** I want it to output *hello \* world*
But I got the text with no change with the current regex.