-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
  • 40,575
  • 10
  • 44
  • 74
Johann
  • 24,056
  • 38
  • 149
  • 245

1 Answers1

0

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

/[a-zA-Z\/\.\"]/g
Jack Bashford
  • 40,575
  • 10
  • 44
  • 74