Discussion:
RegEx filter
(too old to reply)
DsplyName
2003-09-02 23:21:43 UTC
Permalink
I am trying to filter lines of text sent in a channel using a regular exp

$regex(** 99 ** Admin: userid $chr(44) Nickname: nick,...)

I will also write the id, and nick to a hash table.
I cannot seem to get regexps to work
Olathe
2003-09-09 22:47:40 UTC
Permalink
If you are asking for a regular expression to use (that's not entirely clear
from what you said), and the text is actually in that format (I doubt
there's a space between the user ID and the comma, for example), use :

$regex(the text, /\*\* 99 \*\* Admin: (\w+) \054 Nickname: (\w+)/)
Then, $regml(1) will contain the user ID and $regml(2) will contain the
nickname.

Example :
var %null = $regex(** 99 ** Admin: userid $chr(44) Nickname: nick, /\*\* 99
\*\* Admin: (\w+) \054 Nickname: (\w+)/)
echo 4 -a user: $regml(1) nick: $regml(2)

A good book for learning regular expressions (that I learned from) is
Mastering Regular Expressions (published by O'Reilly).
Post by DsplyName
I am trying to filter lines of text sent in a channel using a regular exp
$regex(** 99 ** Admin: userid $chr(44) Nickname: nick,...)
I will also write the id, and nick to a hash table.
I cannot seem to get regexps to work
Loading...