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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VbScript Regular Expression

Status
Not open for further replies.

MarcusH

Programmer
May 3, 2001
22
GB
Hi,

I'm having a problem with I VBScript regular expression.

I want to find FROM: xxxxx (where xxxxx is a number) when it is not proceded with TO: xxxxxx

So in

TO: 123456
FROM: 654321
FROM: 454545


I only want to find FROM: 454545 but I get FROM: 654321 as well.

The regular expression that I'm using is:

re.Pattern="(?!(TO:\s*\d+\s*))FROM:\s*\d+"

I've tried a slight variation on this which is:

re.Pattern="(?!TO:\s*\d+\s*)FROM:\s*\d+"

Your help would be very much appreciated.

Thanks
Marcus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top