From: LJB on 10 Feb 2010 15:37 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 11 Feb 2010 07:17 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 11 Feb 2010 08:10 "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 11 Feb 2010 10:59 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 11 Feb 2010 11:04 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)
|
Next
|
Last
Pages: 1 2 Prev: Connect to WMI remotely with vbscript Next: ANTIVIRUS FREE DOWNLOAD 5351 |