How to exclude Special characters " / \ [ ] : ; | = , + * ? < >

Ashwini Jadhao
Giga Guru

Hi 

I have a single line text variable and in that I want to exclude " / \ [ ] : ; | = , + * ? < > all this special character.
Could you please help me with it?What should be the RegEx for it?

 

Thank you!

7 REPLIES 7

Hi @Ashwini Jadhao ,

 

Did this not help?

string = string.replace(/[&\/\\#,+()$~%.'":*?<>{}]/g, '');

 

Thanks,

Danish

 

no

Ashwini Jadhao
Giga Guru

Hi,

/[\/\\,+'"|:;=*?<>\]\[/]/g
above regex is working for me.
Thank you!