Advertisement

03.31.2008 at 04:03PM PDT, ID: 23284281
[x]
Attachment Details

Expert RegExp advice required

Asked by LeeDerbyshire in Microsoft Visual Basic.Net

I would like to find out how to change occurrences of something like <d:0x8101> (thanks Exchange WebDAV!) in an XML response to <d:x8101> .  Note that the expression I'm interested in must always begin with < and end with > .  The < can be followed by any letter (usually lower case, but both cases would be safer).  The number after : is always 0, followed by an x, and then there are always four digits.  I believe that I can match it with something like "<[a-z]:0x[0-9]+>" (although there are probably lots of better ones), but I don't know how to supply a replacement string to the RegExp object's .Replace method.  Something like;

Dim objRegEx As New RegEx("<[a-z]:0x[0-9]+>")
newText = objRegEx.Replace(myXMLText, something) ' what do I use instead of "something" here?
Start Free Trial
[+][-]03.31.2008 at 04:38PM PDT, ID: 21250077

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Microsoft Visual Basic.Net
Sign Up Now!
Solution Provided By: HonorGod
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.31.2008 at 05:06PM PDT, ID: 21250180

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.31.2008 at 05:23PM PDT, ID: 21250301

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628