Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
melonamin authored Feb 15, 2021
1 parent 80bf031 commit a320dc8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Scripts/Replace Regex.js
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);
}
17 changes: 17 additions & 0 deletions Scripts/Replace.js
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);
}

0 comments on commit a320dc8

Please sign in to comment.