-1

Hello i'm trying to build a simple discord-like text editor with Draftjs, it's my first time working with regex so i'm not really sure how to solve this

assuming i have the following two regex

const boldRegex = /\*\*(.*?)\*\*/g;
const spoilerRegex = /\|\|(.*?)\|\|/g;

which should represent bold text and a spoiler text i have an issue where if i go to a new line the regex doesn't recognize it in full so for example

this works and gets highlighted in bold

** some text ** 

but this doesn't

** some 
text**

and if i do something like this

   ** some 
    text** this gets highlighted **some other text **

0 Answers0