javascript split remove punctuation code example
Example 1: remove punctuation marks from string js
const regex = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g;
const result = WANTED_STRING.replace(regex, '');
Example 2: how to split by words and punctuation in javascript
string.split(/\s*\b\s*/)