Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert from javascript

Status
Not open for further replies.

scrsadmin

Technical User
May 3, 2004
62
US
This is from a javascript that i am trying to convert to vbscript.
How can i do the 6 lines below in VBscript?

dnRE = /dn: \w, \w/i;
cnRE = /^cn: (.*), (.*)/;
givenRE = /^givenname: (.*)/;
snRE = /^sn: (.*)/;
mailRE = /^mail: (\S+)/;
testRE = /@test\.nc\.gov/i;
 
They had explained them to you. What hold you up in writing the equivalent in vbs, as you told them you know the biz in vbs?
 
I desperately tried to understand java and I’m still trying. The script was written by some former admin and now I need to modify it. So I thought I would try to get it to work in JavaScript and I also want to convert it to vbs so I can learn about JavaScript and learn more about vbs. But by now means did I say "I know the biz in vbs". I did say I normally write in vbs but that doesn't mean nor do I want anyone to think I mean to say I know the biz in vbs. I struggle with VBS as well. I don't use it all the time only when I see or am told that the environment needs a script for a task of some kind. Again I didn't mean to imply I know the vbs or java bis I just muddle through. A do a little better job of muddling through vbs. Let me also say that this site has been my main source for vbs and I am thankful for it.
 
[tt]
set dnRE=new regexp
with dnRE
.pattern="dn: \w, \w"
.ignorecase=true
end with

set cnRE=new regexp
with cnRE
.pattern="^cn: (.*), (.*)"
'.ignorecase=false 'default
end with

set givenRE=new regexp
with givenRE
.pattern="^givenname: (.*)"
'.ignorecase=false 'default
end with

set snRE=new regexp
with snRE
.pattern="^sn: (.*)"
'.ignorecase=false 'default
end with

set mailRE=new regexp
with mailRE
.pattern="^mail: (\S+)"
'.ignorecase=false 'default
end with

set testRE=new regexp
with testRE
.pattern="@test\.nc\.gov"
.ignorecase=true
end with
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top