|
dskorren Novice
Joined: 07 Feb 2002 Posts: 48 Location: Philippines
|
Posted: Mon May 19, 2003 1:46 pm
[range] |
i have an alias named test with the following command:
#if (%1 = "a|b|c|d|e|f|g") {#show %1 is in range} {#show %1 is not in range}
When i type test a, the result is always not in range. What is wrong with that alias, and how do i convert it to the form [a~g] to make it shorter?
Thanks in advance |
|
|
|
Anabasis Wanderer
Joined: 26 Jan 2001 Posts: 74
|
Posted: Mon May 19, 2003 3:17 pm |
I'd remove the set you're testing against into a variable, then use the %ismember function to do the actual testing.
Ana |
|
|
|
dskorren Novice
Joined: 07 Feb 2002 Posts: 48 Location: Philippines
|
Posted: Mon May 19, 2003 3:33 pm |
So how do you use the [a~z] pattern matching from the help file? I would like to use it to check for uppercase letters so I can color them differently in the channel, ex: Capitals=yellow, Small Letter=dark cyan, and then punctuations=White. I cant use the %upper() because the function will return the same thing if the argument is a special character.
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon May 19, 2003 4:11 pm |
In your first example, you are missing the curly braces. So it should be:
%1 =~ "{a|b|c|d|e|f|g}"
If you want to use a range, then you do it like this:
%1 =~ "[a-g]"
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon May 19, 2003 5:15 pm |
#TR upper {[A-Z]} {#CW yellow} {} {case}
#TR lower {[a-z]} {#CW cyan} {} {case}
#TR punct {%p} {#CW white} {} {case}
LightBulb
Advanced Member |
|
|
|
dskorren Novice
Joined: 07 Feb 2002 Posts: 48 Location: Philippines
|
Posted: Mon May 19, 2003 5:22 pm |
Thank you very much Kjata and Lightbulb for your help. Much appreciated.
|
|
|
|
|
|