Why “|” (or) does NOT work with string.replace(regex)? [duplicate]

Here is the Codesandbox demo, please fix it:

https://codesandbox.io/p/devbox/regex-test-p5q33w

I HAVE to use multiple replace() calls for same thing. Here is the example:

const initialString = `
{
  "NODE_ENV": "development",
  "SITE_URL": "http://localhost:3000",
  "PAGE_SIZE": {
    "POST_CARD": 3,
    "POST_CARD_SMALL": 10
  },
  "MORE_POSTS_COUNT": 3,
  "AUTHOR_NAME": "John Doe",
  "AUTHOR_EMAIL": "[email protected]",
}
`;

After this call:

const stringData = initialString.replace(/[{}t ]|s+,/gm, '');
console.log('stringData: ', stringData);

I get this:

"NODE_ENV":"development",
"SITE_URL":"http://localhost:3000",
"PAGE_SIZE":
"POST_CARD":3,
"POST_CARD_SMALL":10
,
"MORE_POSTS_COUNT":3,
"AUTHOR_NAME":"JohnDoe",
"AUTHOR_EMAIL":"[email protected]",

You see that , ... empty line with comma, I dont want that of course.

If instead of | I call replace() two times it gets repleaced properly.

const stringData1 = initialString.replace(/[{}t ]/gm, '');
const stringData2 = stringData1.replace(/s+,/gm, ',');
"NODE_ENV":"development",
"SITE_URL":"http://localhost:3000",
"PAGE_SIZE":
"POST_CARD":3,
"POST_CARD_SMALL":10,
"MORE_POSTS_COUNT":3,
"AUTHOR_NAME":"JohnDoe",
"AUTHOR_EMAIL":"[email protected]",

How to fo it with a SINGLE replace() call and what is the explanation, why | fails???