Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A simple IRC bot to perform perl-style s/// regex replacements in channels
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.md
config.yml.dist
memory.rb
reggie.rb

README.md

Reggie

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.

Usage

<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.

Requirements

Reggie requires the cinch gem.

Something went wrong with that request. Please try again.