RegEx on server side scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 05:29 AM
Hello,
Need to write script in server side to replace / or \ with empty space.
I found below in community:
The SNC.Regex API is not available for scoped applications. For scoped applications, remove the SNC.Regex API and use standard JavaScript regular expressions.
We are using scoped applications, in that case how to achieve this?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 05:44 AM
Hi
You can try this
var string = 'test \ document / printed \ updated';
var regex = /\//g;
var newText = string.replace(regex, ' ');
gs.log(newText);
//this will print "test document printed updated
Mark as correct and helpful if it solved your query.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2022 01:51 AM
Feel free to ask if you still have questions or else you can close this thread by marking an answer as correct so it benefits future visitors.
Regards,
Sumanth