1
0
mirror of https://tildegit.org/ben/sedbot synced 2025-03-14 10:20:42 +00:00
2019-03-30 19:25:44 -04:00
2019-03-30 17:50:14 -04:00
2019-03-30 19:25:44 -04:00
2013-11-13 11:49:37 +01:00
2015-05-30 13:56:41 +02:00
2019-03-30 17:50:14 -04:00
2019-03-30 19:25:44 -04:00

sedbot

sedbot is an IRC search-replace bot written using bash and sed.

Usage: Edit the settings on top of sedbot.bash and run it under an unprivileged user.

Only the s command and g and i flags are supported. Multiple regular expressions can be used at once, delimit them with spaces in between the flags and the s next one's s command. The last one may omit the trailing / if it has no options.

Example usage in chat:

<foo> Hello ther!
<foo> s/ther/there
<sedbot> <foo> Hello there!

<foo> I'm programmign right now
<bar> foo: s/gn/ng/
<sedbot> <foo> I'm programming right now

<foo> abcdefghi
<foo> s/\(.\)./\u\1/g s/
<sedbot> <foo> ACEGi
<foo> s/[a-e]//g s/\(.\)\(.\)/\2\1
<sedbot> <foo> gfhi

Note that the bot uses the standard grep (POSIX) regular expressions, i.e. use .\+ and \(foo\)\? instead of .+ and (foo)? as you'd do in egrep or other regex engines. Backreferences are written like s/\(.\)/\1, where \1 matches the first capturing group. Read more about sed regular expressions.

Description
No description provided
Readme GPL-3.0 103 KiB
Languages
Shell 100%