Re: Match text - case sensitive
- From: "Jimmy" <j@xxx>
- Date: Wed, 30 Aug 2006 15:29:18 -0400
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
.
- Follow-Ups:
- Re: Match text - case sensitive
- From: Brian Cahill
- Re: Match text - case sensitive
- References:
- Match text - case sensitive
- From: Brian Cahill
- Match text - case sensitive
- Prev by Date: Match text - case sensitive
- Next by Date: Re: Need help with simple move script?
- Previous by thread: Match text - case sensitive
- Next by thread: Re: Match text - case sensitive
- Index(es):
Relevant Pages
|