TastyWheat
Registered User.
- Local time
- Yesterday, 20:03
- Joined
- Dec 14, 2005
- Messages
- 125
It might be my pattern that's wrong, rather than something being wrong with RegExp, but I'm unable to replace multiple lines of a string using one statement. Here's an example of my string:
I'm looking to remove everything above the first set of underscores (in red). Here's the code I've tried (seems to do nothing except remove the whitespace between "Party" and the first set of underscores):Jane Doe
Marketing Manager
Good Foods Inc.
From: jdoe@goodfoods.com
Sent: Wednesday, April 08, 2009 1:20 PM
To: Bob White
Subject: Party
_____
When: 04/18/2009
Time: 6:30 PM
Where: Jim's Steakhouse
_____
Code:
Set RGX = New VBScript_RegExp_55.RegExp
RGX.IgnoreCase = True
RGX.MultiLine = True
RGX.Global = True
RGX.Pattern = "[.\r\n\W]*_____"
text = RGX.Replace(MailItem.Body, "_____")