jaytea commented on a Page, Simple Highlight  -  Nov 19, 2010

napa's check is no better than isin; the only potential advantage it has over a plain if ($me isin $1-) is the ignoring of control codes in $1- with //S (which can, of course, also be achieved with $strip($1-)). it even fails where isin doesn't: when $me contains '\E'. an unlikely occurrence, but something to consider in general.

i can't tell if this is intended to work with mIRC's highlight system (ie. detect when an incoming line matches an entry on your highlight list) but if it is, it is not trivial to make a regular expression that behaves as mIRC's highlight system does. mIRC's highlight matching routine is simple only in terms of mIRC script: if an incoming line contains an entry in your highlight list, and it does not have a non-alphanumeric character (think: isalnum) on either side, then it matches successfully. the problem is, there is no construct in PCRE, mIRC's regex flavour, that behaves as isalnum does. replicating the highlight detection in regex requires you to provide the whole list of characters which mIRC considers alphanumeric (or the list of non-alphanumeric ones).

there are around 17,500 non-alphanumeric Unicode characters, and around 350 distinct contiguous ranges of such characters. creating a regular expression with this information would be, i'm sure you'll agree, tedious.

thankfully, mIRC has $highlight(), which lets you test whether a line matches an entry on your highlight list:

if ($highlight($1- $lf)) {

$lf can't be a part of an incoming message nor, presumably, part of your highlight entry; we can use it to turn $1- non-numerical, since $highlight(N) is used to return the Nth entry in the highlight list.

Jethro_, $me can't contain a space. what you have essentially checks:

if ($istok($strip($1-), $me, 32)) {
 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.