Skip to content
A simple IRC bot to perform perl-style s/// regex replacements in channels
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Reggie is a little IRC bot that watches for perl-style s/match/replace/ in chat and performs the actual regex replace (using Ruby's regex) on the previous line and prints the result.


<scott> This is a tset.
<scott> s/tset/test/
<reggie> <scott> This is a test.

To replace the last line you said, ignoring other users' lines, prepend an exclamation mark to your replacement line.

<scott> This is a tset.
<some_guy> This is another tset.
<scott> s/tset/test/
<reggie> <some_guy> This is another test.
<scott> !s/tset/test/
<reggie> <scott> This is a test.

You can use multiple exclamation marks to refer to your even earlier lines. You can only use as many exclamation marks as the @max_bangs instance variable in reggie.rb, which is 3 by default.

If you don't use any exclamation marks and reggie cannot match your regex to the previous line, it will try to match against your previous lines from most recent to earliest as if you had attempted !s, !!s, ..., until you got a match. This is also limited by the @max_bangs instance variable.

<scott> This is a tset.
<some_guy> Blah blah blah!
<scott> s/tset/test/
<reggie> <scott> This is a test.

Reggie handles /me (ACTION) lines correctly.

* scott is tseting.
<scott> s/tset/test/
<reggie> * scott is testing.

Ruby Regex

A decent reference for Ruby regex can be found here.


Reggie requires the cinch gem.

Something went wrong with that request. Please try again.