Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Added lots of examples and made README clearer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Olson committed Feb 11, 2012
1 parent ee06a8c commit 57ea298
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,41 @@ Usage
<reggie> <scott> This is a test.
```

Prepend 'n' exclamation marks before the "s/" to make reggie replace the 'n'th
last line you said (ignores the lines of others). 'n' is limited to the
`@max_bangs` instance variable in reggie.rb.
To replace the last line *you* said, ignoring other users' lines, prepend an
exclamation mark to your replacement line.

``` irc
<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 `!`s and reggie cannot match your regex to the previous
line, it will try to match against your 'n' previous lines from most recent to
earliest.
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.

Reggie handles /me (ACTION) lines correctly.
``` irc
<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.

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

Ruby Regex
----------
Expand Down

0 comments on commit 57ea298

Please sign in to comment.