mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
Re: if ($1 ischar) { echo Yes it is! } [Re: westor] #216889 06/12/09 11:39 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
I think he is asking for an ascii character operator for evaluation purposes. I'm sure you can use regex along with a custom $ischar identifier for that matter:
Code:
alias -l ischar if ($regex($1-,/(\W+)/S)) return $regml(1) 
on *:TEXT:*:?:if ($ischar($1-)) echo -s WARNING: $nick just used $+(",$v1,") in private.
P.S. I know using an alias is unnecessary, but since westor's brought the $v1 up...I thought it'd be for the best.

Re: if ($1 ischar) { echo Yes it is! } [Re: argv0] #216890 06/12/09 12:32 PM
Joined: Dec 2008
Posts: 1,511
westor Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,511
The Riammus has understand what i mean, I gave you examples but i have not more examples, anyway!

Re: if ($1 ischar) { echo Yes it is! } [Re: Tomao] #216893 06/12/09 02:13 PM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
\W? So basically...
Code:
if ($1- !isalnum)

...except that \W also includes the _ character.

Re: if ($1 ischar) { echo Yes it is! } [Re: 5618] #216902 06/12/09 03:45 PM
Joined: Mar 2004
Posts: 54
Z
Zed Offline
Babel fish
Offline
Babel fish
Z
Joined: Mar 2004
Posts: 54
Code:
if ($len($1-) == 1) && ($1- isalnum) { }

or

if (? iswm $1-) && ($1- isalnum) { }

Re: if ($1 ischar) { echo Yes it is! } [Re: westor] #216904 06/12/09 03:55 PM
Joined: Oct 2004
Posts: 8,327
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,327
Originally Posted By: westor
The Riammus has understand what i mean, I gave you examples but i have not more examples, anyway!


Everything I put in that example was correct? It was just basically random. Anyhow, if that was correct, then the examples using $len and isalnum will work fine except for unicode characters. Might not be a bad idea for isalpha and isalnum to match with unicode such as Japanese.

Anyhow, westor, if anything, your requirements would seem to make more sense for adding issymbol instead of ischar. Not only would it make more sense to people as far as what it's checking, but it would work well with the other is___ checks (you'd then have alpha,number,symbol to check and I think that would be all you'd need). Of course, what a symbol is would have to be determined for that and opinions on that may differ from person to person... probably why it's not there.


Invision Support
#Invision on irc.irchighway.net
Page 2 of 2 1 2