Match text - case sensitive
- From: "Brian Cahill" <brianccahill@xxxxxxxxxxx>
- Date: 30 Aug 2006 12:17:03 -0700
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
.
- Follow-Ups:
- Re: Match text - case sensitive
- From: Jimmy
- Re: Match text - case sensitive
- Prev by Date: Re: writing another scripting language
- Next by Date: Re: Match text - case sensitive
- Previous by thread: Re: Match text - Case Sensitive
- Next by thread: Re: Match text - case sensitive
- Index(es):
Relevant Pages
|