Running into an issue doing a regex replacement…
the pattern [ ]+$
works fine in the VSCode editor but not when I put it in code:
data = `
Hello
World
test
.
`
console.log(data.replace(/[ ]+$/, ""))
If we run that snippet we can see that the regex did not do the replacements
Fresh out of ideas what could be the problem