Re: Match text - case sensitive

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



reg expressions shouldnt be used if youre not matching a pattern. if youre
simply looking for a string, use string functions... InStr, Left, Mid,
Right... to convert case before matching you can use Lcase and Ucase


"Brian Cahill" <brianccahill@xxxxxxxxxxx> wrote in message
news:1156965423.399798.40030@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,

I'm trying to write a script that will match a particular string and it

must be lower case. After it creates a collection based off that
logic, it will loop through the collection with the entries that match.

Here is my attempt so far. I've seen some stuff on InStr but from
what I'm reading it seems that Regular Expressions is the better way to

go. A little help please, thanks.


Dim oUser, strLogFile, strUserDN, objUser, email
Dim colMatches
Dim objRegExpr


oUser = "LDAP://CN=test,CN=Users,DC=test,DC=com";
Set objUser = GetObject(oUser)
Set objRegExpr = New regexp


objRegExpr.Pattern = "smtp:"
objRegExpr.IgnoreCase = False


For Each email In objUser.GetEx("proxyAddresses")
email = Left(email,5)
WScript.Echo email
Set colMatches = objRegExpr.Execute(email)
Next
'objUser.SetInfo
For Each objMatch in colMatches
WScript.echo objMatch.Value
Next



.



Relevant Pages

  • RE: How can I create a outlook appointment item from data in a e-m
    ... If you know the starting point of where the text you want occurs, use InStr ... Eric Legault (Outlook MVP, MCDBA, MCTS: ... if I have a string that looks like this: ... Once you get the text you need, it's easy to create a new appointment item: ...
    (microsoft.public.outlook.program_vba)
  • Parsing a string
    ... The function also has two optional input parameters, ... default delimiter value in the function definition line ... then using the instr() functions. ... Dim ArrayBreakPosAs Integer, strPrefix As String ...
    (microsoft.public.access.queries)
  • Re: performance surprise -- why?
    ... On 25 Aug 2004, Anno Siegel wrote: ... >> string to a file and counted the lengths of the lines using a simple ... The substitution method must move parts of the ... > The results show indexing and global matching in the same ballpark, ...
    (comp.lang.perl.misc)
  • Re: Search using a list of words
    ... into a String in VB and use the Instr function to search that string for ... list of search words also in upper case. ... Even such a simple solution using Instr would be quite fast, ... you'll need to go to all that trouble and I think you'll find Instr fast ...
    (microsoft.public.vb.general.discussion)
  • Re: performance surprise -- why?
    ... > CCCTAAACCCTAAACCCTAAACCCTAAACCTCTGAATCCTTAATCCCTAAATCCCTAAAT...(30MB string). ... The substitution method must move parts of the ... The results show indexing and global matching in the same ballpark, ... sub substitute { ...
    (comp.lang.perl.misc)