I made a regex to highlight keywords found in a text by another tool.
new RegExp(highlightedKeywords.map(v => `\\b${v}\\b`).join('|') || /.^/, 'gi'), match => `<mark>${match}</mark>`)
I would like to make this regex treat every whitespaces as the same because the tool who extract keywords from the text convert every whitespace as space, so for example I have a keyword "the cat" not found because the actual text is "the\ncat".
I don't want to ignore whitespaces because "the cat" should not match "thecat" but I would like to match "the\tcat" or even "the\n \tcat"