sajad torkamani

Suppose you want to remove any character that is not a letter or a space. Here’s one approach:

function removeChars(str) {
  return str.replace(/[^a-zA-Z\s]/g, '')
}
Tagged: Regex