Re: Character Escapes Don't Work in VB Regex Replace?
From: Jay B. Harlow [MVP - Outlook] (Jay_Harlow_MVP_at_msn.com)
Date: 03/05/04
- Next message: Jeremy B.: "Remoting Excel problems"
- Previous message: Tom Shelton: "Re: How can I call this function from another button click?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 4 Mar 2004 23:20:11 -0600
Chris,
If you are still following this thread...
While searching for something else, I just came across RegEx.Escape and
RegEx.Unescape that will escape & unescape strings for you (including
whitespace). It may help in your efforts.
Hope this helps
Jay
"Chris Anderson" <anonymous@discussions.microsoft.com> wrote in message
news:2AC493A6-E389-44EF-A482-9590787248D7@microsoft.com...
> Well, I figured I was hoping too much. I'd still call it a bug, though. It
actually says in the documentation for regex that all character escapes are
supported both in regular expressions and replacement patterns.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/cpconcharacterescapes.asp
>
> Unfortunately, it's only half true in VB. I only mention C# because I
wanted to see if this was a VB specific issue, or the .net regex engine.
Using escape characters in C# replacement patterns does work as it says in
the documentation, and as in every other language or application that
implements regex. I've been using VB for 6 years, and think .net is great,
but it's very disappointing and confusing that VB does implement the regex
behavior in a standard way. I'll probably end up writing my own fix, and
share it with anyone else who is frustrated by this.
- Next message: Jeremy B.: "Remoting Excel problems"
- Previous message: Tom Shelton: "Re: How can I call this function from another button click?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|