Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #2000031 // A replacement executor (draft)

New Tinybrain snippet

-- input 1: replacement (content of "replacement" snippet)
-- input 2: content (content of other snippet)
--
-- probably does not handle special characters well... but should work for a first test

_, _, from, to = replacement:find("s/(.*)/(.*)/")
return content:gsub(from, to)

Author comment

e.g. for #2000029

download  show line numbers   

Snippet is not live.

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #2000031
Snippet name: A replacement executor (draft)
Eternal ID of this version: #2000031/1
Text MD5: fb9cec335e135700beb71e61d3b49d92
Author: stefan
Category:
Type: New Tinybrain snippet
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-03-12 21:11:03
Source code size: 283 bytes / 7 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 527 / 129
Referenced in: [show references]