Originally Posted By: drum
I don't think there is any bug here. mIRC just defines "isupper" and "islower" differently than you were expecting. In particular, the following two lines will always give the same result, and you can think of the first line just being a shortcut for the second line:

Code:
if (%c isupper) { ... }
if (%c === $upper(%c)) { ... }


Assuming you want the same behavior you get with regex, and if you are working with a variable %c that contains a single character, you can use:

Code:
if ($asc(%c) isnum 65-90) { echo -a %c is an uppercase letter }
if ($asc(%c) isnum 97-122) { echo -a %c is a lowercase letter }


I'm not sure if there is a more efficient way, though.


Yeah, this will work:
Code:
if (%c === $upper(%c)) { ... }


But this wont: (as it will be true for signs too)
Code:
if (%c isupper) { ... }


The problem comes in when you want to count the uppercase letters in a message for example.
Without a regex you'd need to use isupper and islower, and do the message char by char.
For example like this:
Code:
char.upper {
  ; $1- Message
  tokenize 32 $remove($1-, $chr(32))
  var %i = 1, %c = 0
  while (%i <= $len($1-)) {
    if ($mid($1-, %i, 1) === $upper($v1)) { inc %c }
    inc %i
  }
  return %c
}


Now that works, but a regex group is incredibly much faster.
1000 iterations of that on my comp is 1872 ticks, with the upper regex group its 63. (which doesn't include the unicode uppercase letters I need, so it's useless)