I my regex doesnt work if there is multiple lines.I'm trying to match that everything inside /#----- #/ symbols. In one single line it works fine. You can check it here: https://regex101.com/r/yZTXwh/3
code:
highlightMessage(message) {
return message.replace(
/\/#\s*(.*?)\s*#\//g,
(_, g) => `<span class='highlited-message'>${g}</span>`,
)
}
text:
Hello
/# my name
is
Mike
nice to meet you
#/