regex to replace all punctuation code example
Example 1: remove punctuation marks from string js
const regex = /[!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~]/g;
const result = WANTED_STRING.replace(regex, '');
Example 2: c# remove all punctuation from string
string output = new string(OriginalString.Where(c => !char.IsPunctuation(c)).ToArray());