-2

How can I use regex to replace all the characters in a string that are either alphabetic, a forward slash, a period or double quotations?

I am able to do letters:

"abcd123/./"".replace(/([^\x00-\x80]|\w)/g, "someReplacementText"));
Jack Bashford
  • 43,180
  • 11
  • 50
  • 79
Johann
  • 27,536
  • 39
  • 165
  • 279

1 Answers1

0

Just place all the characters you want into a non-negated character set:

/[a-zA-Z\/\.\"]/g
Jack Bashford
  • 43,180
  • 11
  • 50
  • 79