-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
{ | ||
"id": "co.ameba.Esse.ExternalFunctions.ReplaceRegex", | ||
"name":"Replace with Regex", | ||
"description":"Find and Replace. This is a custom script, please edit to your liking", | ||
"category":"Other", | ||
"author":"Ameba Labs", | ||
} | ||
**/ | ||
|
||
const searchRegExp = /\s/g; // find all spaces, 'g' is important to enforce 'replace all' | ||
const replaceWith = '-'; | ||
|
||
function main(input) { | ||
return input.split(searchRegExp).join(replaceWith); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
{ | ||
"id": "co.ameba.Esse.ExternalFunctions.Replace", | ||
"name":"Replace", | ||
"description":"Find and Replace. This is a custom script, please edit to your liking", | ||
"category":"Other", | ||
"author":"Ameba Labs", | ||
} | ||
**/ | ||
|
||
const search = '&'; | ||
const replaceWith = ' and '; | ||
|
||
|
||
function main(input) { | ||
return input.split(search).join(replaceWith); | ||
} |