I used this ((?=(?!\bTODO\b)*?;).*)((?=.*?\bTODO\b).*)[^\n] regex to look for TODO inside commented text, its valid javascript regex, see this demo
But when I use
editor.getModel().findMatches("((?=(?!\\bTODO\\b)*?;).*)((?=.*?\\bTODO\\b).*)[^\\s]", true, true, true, null, true);
it returns empty FindMatch[]. Removing negative-lookahead ((?=.*?;).*)((?=.*?\bTODO\b).*)[^\n] it behave correctly, but it match invalid lines, obviously.
It is bug of monaco-editor, or just I do something wrong?