How about...

set re = new regexp

re.Global = true

re.Pattern = """(.*?)""" 

set oM = re.execute(a)

for each str in oM: Wscript.echo replace(str,"""","",1,-1,1): next

 

From: Christopher Bodnar [mailto:[email protected]] 
Sent: Wednesday, August 05, 2009 6:09 am
To: NT System Admin Issues
Subject: VBScript Regular expression help

 

Can someone help me out with a regular expression in VBScript? 

 

This does exactly what I want it to do, for the "{" character:

 

myRegExp.Pattern = "[^{]*\{([^}]*)\}"

 

So if my string is the following:


("Select * FROM {SQL_TABLE} Where Field={SQL_FIELD}")

 

It returns:

 

SQL_TABLE

SQL_FIELD

 

I want the exact same function, but for the double quote character. For
example my string will look something like this:

 

("SERVER1", "SERVER2", "SERVER3")

 

And I'd like to return:

 

SERVER1

SERVER2

SERVER3

I know you have to escape the quote character, but I'm not having any luck
with the pattern so far. 

 

Thanks,

Chris Bodnar, MCSE
Sr. Systems Engineer
Distributed Systems Service Delivery - Intel Services
Guardian Life Insurance Company of America
Email: [email protected]
Phone: 610-807-6459
Fax: 610-807-6003

 

 

 
  _____  


This message, and any attachments to it, may contain information that is
privileged, confidential, and exempt from disclosure under applicable law.
If the reader of this message is not the intended recipient, you are
notified that any use, dissemination, distribution, copying, or
communication of this message is strictly prohibited. If you have received
this message in error, please notify the sender immediately by return e-mail
and delete the message and any attachments. Thank you. 


~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to