I'm trying to match some paragraphs in Google Docs but the pattern that I wanted to use for it doesn't match the string when run inside a Google Script. However, it works properly on regex101 so I guess I'm missing something. Do you know what?
This is a sample of what I have:
function test() {
var str = "brown fox → jumps over the lazy dog";
var definitionRe = new RegExp('([\w\s]+)\s+[\u2192]\s+(.+)', 'g');
var definitionMatch = definitionRe.exec(str); // null
var dummy = "asdf"; // makes the debugger happy to break here
}