Looking to achieve
syntax highlighting for "new RegExp
" using regex syntax, similar to the regex literal.
Any suggestions on how to accomplish this?
https://i.sstatic.net/eIArX.png
/^this\b(.*?)\bis(:{0,1})/g;
new RegExp(/*regex*/ `^this\b(.*?)\bis(:{0,1})`, 'g'); // << syntax higlight?
Update:
Realized that it might not be a good idea after all:
-- The escape character \
behaves differently in Strings than in Regex Literals
-- String should not be highlighted as Regex Literal (unless there's a solution for the \
escape dilemma)