0

In my react-native application, I have a requirement to accept 7 types of special characters in a string. It could be all 7, few of them or none of them.

Special characters are (),@'/-

so the accepted string will be like following.

  1. ABcd()ef,/'-@sdf => accepting all 7
  2. ABcd(), => accepting few of 7
  3. ABcddfg => accepting none of 7

How should I write this regex in java script?

mplungjan
  • 169,008
  • 28
  • 173
  • 236
Shashika Virajh
  • 8,497
  • 17
  • 59
  • 103

1 Answers1

0

Perhaps you mean

https://regex101.com/r/Vt9wmF/1

/[\w\(\),@'\/-]/g
mplungjan
  • 169,008
  • 28
  • 173
  • 236