From: LJB on
In regular expression how do I say characters A-Z except I and O? I'd rather
not list each of the 24 valid characters.

Thanks,
LJB


From: Steve on
LJB wrote:
> In regular expression how do I say characters A-Z except I and O? I'd
> rather not list each of the 24 valid characters.

[A-HJ-NP-Z]

Lists of Matching Characters (Scripting)
<http://msdn.microsoft.com/en-ca/library/ta6y6h4z%28VS.85%29.aspx>

--
Steve

We know accurately only when we know little, with knowledge doubt
increases. -Johann Wolfgang von Goethe



From: LJB on

"Steve" <cerberus40(a)gmail.com> wrote in message
news:OTyP8QxqKHA.4636(a)TK2MSFTNGP06.phx.gbl...
> LJB wrote:
>> In regular expression how do I say characters A-Z except I and O? I'd
>> rather not list each of the 24 valid characters.
>
> [A-HJ-NP-Z]
>
> Lists of Matching Characters (Scripting)
> <http://msdn.microsoft.com/en-ca/library/ta6y6h4z%28VS.85%29.aspx>
>
> --
> Steve
>
> We know accurately only when we know little, with knowledge doubt
> increases. -Johann Wolfgang von Goethe
>
>
>

Thank you. I had tried [A-Z^IO] without results I wanted. Since this pattern
repeated several times I wasn't interested in listing the entiere alphabet
except I & O. I never thought to split it as you did.

BTW what is a good tool for developing and testing patterns. I've used Eric
Gunnerson's Regular Expression WorkBench. I especially like the interpret
function. Another, Ultrapico's Expresso, was quite good but doesn't run on
my PC at the moment. I'll neeed to reinstall it. Both are free.

LJB


From: Evertjan. on
LJB wrote on 11 feb 2010 in microsoft.public.scripting.vbscript:

> Thank you. I had tried [A-Z^IO] without results I wanted.

^ inside [] isd only "NOT" if it is in first position.

If you do not like Steve's [A-HJ-NP-Z] solution,
you could try this:

var r = !/([IO]|[^A-Z])/.test('A');
alert(r);

r = !/([IO]|[^A-Z])/.test('I');
alert(r);



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: Evertjan. on
Evertjan. wrote on 11 feb 2010 in microsoft.public.scripting.vbscript:

> LJB wrote on 11 feb 2010 in microsoft.public.scripting.vbscript:
>
>> Thank you. I had tried [A-Z^IO] without results I wanted.
>
> ^ inside [] isd only "NOT" if it is in first position.
>
> If you do not like Steve's [A-HJ-NP-Z] solution,
> you could try this:
>
> var r = !/([IO]|[^A-Z])/.test('A');
> alert(r);
>
> r = !/([IO]|[^A-Z])/.test('I');
> alert(r);

Sorry, did not realize this is the VBS NG,
I hope the Javascript example is clear.

[IO]|[^A-Z] gives the inverse of the requested result.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)