JavaScript
I have a string as follows:
#UNICODE#{1f600} #UNICODE#{1f600}
and I want to replace each occurrence of '#UNICODE#' with '\u', so the output should be like
\u{1f600} \u{1f600}
Tried many different regex in .replace function but no luck.
like
('#UNICODE#{1f600} #UNICODE#{1f600}').replace(/#UNICODE#/g,/\u/)
/\u/{1f600}/\u/{1f600}
('#UNICODE#{1f600} #UNICODE#{1f600}').replace(/#UNICODE#/g,\u)
Invalid unicode escape sequence
and so on.
Any bright ideas ? Thanks in advance.