Hi,

Code:
 
if $regex($1-,/^!add(?:me)?(\s[ab])?$/i) { echo -a $regml(1) | ... }


So as you can see, due to the /i the match is case insensitive, and when the second letter (a or b) is matched, the match will be stored in $regml(1)

So 3 possibilities:

1) regex doesn't match
2) regex matches, but only on !add or !addme, so $regml(1) will be empty as there is no 2nd parameter (a or b) given
3) regex matches, with the 2nd parameter (a or b) which is stored in $regml(1)

Note that i used the echo command simply as an example.


Greetz


Edit: Note that you don't even need a regex to do what you want, although the regex is a little tidier. You could do:
Code:
 
if $istok(!add !addme,$lower($1),32) {
  if $istok(a b,$lower($2),32) { ... }
  else { ... }
}

Well you see where I'm going with this smile


Last edited by FiberOPtics; 06/05/04 08:42 PM.

Gone.