Regular expressions for XML table

tw607

New member
Joined
Aug 15, 2007
Messages
2
Programming Experience
Beginner
Hi all,
I was wondering if anyone was familiar with regular expressions in VB.NET.
Right now I have a function that brings in a parameter and searches through an xml table for that parameter highlighting it.
My problem is that I want to highlight the entire row which the parameter is located, not just the word. My code is as follows:
VB.NET:
 Public Function Highlight (Search_Str As String, InputTxt As String) As String
  Dim RegExp As RegEx = New Regex(Search_Str, RegExOptions.IgnoreCase)
  Highlight=RegExp.Replace(InputTxt, New MatchEvaluator(AddressOf ReplaceKeyWords))
  RegExp = Nothing
 End Function

The table that is the source of the search is as follows:
HTML:
      <TableBody wp:type="tablebody">
        <tr wp:type="tr_body">
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1013439" wp:style="display: block;"> 10-6 </CellBody> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBodyCaps wp:type="para" wp:id="1013441" wp:style="display: block; color: #000000; font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: uppercase; vertical-align: baseline"> </CellBodyCaps> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBodyCaps wp:type="para" wp:id="1013443" wp:style="display: block; color: #000000; font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 0pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: 0pt; text-transform: uppercase; vertical-align: baseline"> </CellBodyCaps> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1013445" wp:style="display: block;"> EVACUATION LIGHT (Refer to Figure 10-1 for NHA) </CellBody> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1013447" wp:style="display: block;"> REF </CellBody> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1013449" wp:style="display: block;"> 111455001 </CellBody> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1013451" wp:style="display: block;"> LUMIN </CellBody> 
        </TableCell>
NULL
        </tr>
      </TableBody>



Does anyone know a simple regular expression I could use to solve this? TIA
 
Back
Top