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:33 AM
if its simply removing / or \, why don't you use replace function in javascript:
CHeck out below link:
https://www.w3schools.com/jsref/jsref_replace.asp
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 05:38 AM
Eg: File name is the field where it has the value as "test \ document / printed \ updated" this needs to be replaced as "test document printed updated".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 06:17 AM
The example that I shared had everything
text.replace(/\//g, " ");
Test by using background script:
var textStr= "test \ document / printed \ updated";
gs.info(textStr.replace(/\//g," "));
OP:
test document printed updated
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2022 05:37 AM
Eg: File name is the field where it has the value as "test \ document / printed \ updated" this needs to be replaced as "test document printed updated".