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: 565 / 144
Referenced in: #525 - de.tinybrain.nt.nt01.ExecuteReplacement
#2000032 - A result for replacement ##2000029 on #2000028 using replacer #2000031
#2000034 - A result for replacement #2000033 on #2000028 using replacer #2000031
#2000036 - A result for replacement #2000035 on #2000028 using replacer #2000031
#2000038 - A result for replacement #2000037 on #2000028 using replacer #2000031
#2000040 - A result for replacement #2000039 on #2000028 using replacer #2000031
#2000041 - A result for replacement #2000033 on #2000032 using replacer #2000031
#2000042 - A result for replacement #2000039 on #2000041 using replacer #2000031
#3000190 - Answer for stefanreich(>> t 20 questions)
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)