List Info

Thread: Help with Regex and XML File




Help with Regex and XML File
user name
2006-12-29 04:46:17
Hi, hoping I can get some quick help here. The following
chunk of code
appears within an XML file that I am opening and reading in
as a
string. I need to replace this entire section with a new
section
dynamically and I am having trouble using a regular
expression to
select this entire region (to be later used in a replace).

This is the regular expression I though would work.

<w:p.*(?=[INTRODUCTION])(.|n)*?</w:p>

Here is the chunk of code I want to identify.

<w:p wsp:rsidR="003061B7"
wsp:rsidRPr="008D3C80"
wsp:rsidRDefault="003061B7">
 <w:pPr>
  <w:rPr>
   <w:rFonts w:ascii="Tahoma"
w:h-ansi="Tahoma" w:cs="Tahoma"/>
   <wx:font wx:val="Tahoma"/>
   <w:sz w:val="20"/>
   <w:sz-cs w:val="20"/>
  </w:rPr>
 </w:pPr>
 <w:r wsp:rsidRPr="008D3C80">
  <w:rPr>
   <w:rFonts w:ascii="Tahoma"
w:h-ansi="Tahoma" w:cs="Tahoma"/>
   <wx:font wx:val="Tahoma"/>
   <w:sz w:val="20"/>
   <w:sz-cs w:val="20"/>
  </w:rPr>
  <w:t>[INTRODUCTION]</w:t>
 </w:r>
</w:p>

I have several sections that look identical, except they
have something
other than INTRODUCTION... Please help.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://grou
ps-beta.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )