Re: regex for l33t speak

2005-03-25 Thread Randy W. Sims
Oops, I forgot to detab before inlining that, and there was some loose ends. Here it is again inlined and attached. It's not optimized in any way, opting instead for a quick straightforward implementation. Incomplete, possibly buggy, completely undocumented. I didn't write it as a patch for Cas

Re: regex for l33t speak

2005-03-25 Thread Randy W. Sims
Andrew Gaffney wrote: Wow, this is more difficult than I first thought. Not really. Just for kicks here is a simple driver: #!/usr/bin/perl use strict; use warnings; use Leetspeak; # $Leetspeak::DEBUG = 1; my $word = shift( @ARGV ); my $l33t = Leetspeak->new(); my $translation = $l33t->translate( $

Re: regex for l33t speak

2005-03-24 Thread Chris Devers
On Thu, 24 Mar 2005, Randy W. Sims wrote: > The only problem with that is that a dictionary is required for > it to work because each "symbol" can have multiple translations. Not only that -- a 'leet word could have multiple possible meanings. For example, "pwn" ("own") could just be a typo for

Re: regex for l33t speak

2005-03-24 Thread Andrew Gaffney
Randy W. Sims wrote: The only problem with that is that a dictionary is required for it to work because each "symbol" can have multiple translations. Taking info from the wikipedia[1]: a final "s" can be changed to "z" to get the l33t, but to reverse it you have to check first with the "z" becau

Re: regex for l33t speak

2005-03-24 Thread Randy W. Sims
Paul Johnson wrote: On Thu, Mar 24, 2005 at 02:25:19AM -0600, Andrew Gaffney wrote: Randy W. Sims wrote: Andrew Gaffney wrote: I'm trying to come up with a regex for my IRC bot that detects 1337 (in order to kick them from the channel). I can't seem to come up with one that will have few false p

Re: regex for l33t speak

2005-03-24 Thread Paul Johnson
On Thu, Mar 24, 2005 at 02:25:19AM -0600, Andrew Gaffney wrote: > Randy W. Sims wrote: > >Andrew Gaffney wrote: > > > >>I'm trying to come up with a regex for my IRC bot that detects 1337 > >>(in order to kick them from the channel). I can't seem to come up with > >>one that will have few false p

Re: regex for l33t speak

2005-03-24 Thread Andrew Gaffney
Randy W. Sims wrote: Andrew Gaffney wrote: I'm trying to come up with a regex for my IRC bot that detects 1337 (in order to kick them from the channel). I can't seem to come up with one that will have few false positives but also work most of the time. Has anyone done something like this before?

Re: regex for l33t speak

2005-03-24 Thread Randy W. Sims
Andrew Gaffney wrote: I'm trying to come up with a regex for my IRC bot that detects 1337 (in order to kick them from the channel). I can't seem to come up with one that will have few false positives but also work most of the time. Has anyone done something like this before? Does anyone have any

Re: regex for l33t speak

2005-03-23 Thread Andrew Gaffney
Thomas Bätzler wrote: Andrew Gaffney <[EMAIL PROTECTED]> wrote: Too literally. Basically, I'm trying to match a word that contains a mix of >=2 numbers (possibly next to each other) and letters. My current regex is: \b\d*[a-zA-Z]*(\d+[a-zA-Z]+)+\d*[a-zA-Z]*[^:,]\b but that seems to catch too muc

RE: regex for l33t speak

2005-03-23 Thread Thomas Bätzler
Andrew Gaffney <[EMAIL PROTECTED]> wrote: > Too literally. Basically, I'm trying to match a word that > contains a mix of >=2 numbers (possibly next to each other) > and letters. My current regex is: > > \b\d*[a-zA-Z]*(\d+[a-zA-Z]+)+\d*[a-zA-Z]*[^:,]\b > > but that seems to catch too much. Eve

Re: regex for l33t speak

2005-03-23 Thread Chris Devers
On Wed, 23 Mar 2005, Andrew Gaffney wrote: > I'm trying to come up with a regex for my IRC bot that detects 1337 > (in order to kick them from the channel). For those unfamiliar with 'leet, see here:

Re: regex for l33t speak

2005-03-23 Thread Andrew Gaffney
Tim Johnson wrote: First off, "perldoc perlre" is a good place to start. What do you have so far? Does something like /\b1337\b/ work? Or am I taking you too literally? Too literally. Basically, I'm trying to match a word that contains a mix of >=2 numbers (possibly next to each other) and letter

RE: regex for l33t speak

2005-03-23 Thread Tim Johnson
First off, "perldoc perlre" is a good place to start. What do you have so far? Does something like /\b1337\b/ work? Or am I taking you too literally? -Original Message- From: Andrew Gaffney [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 23, 2005 5:52 PM To: beginners@perl.org Subjec