View Single Post
  #1 (permalink)  
Old February 5th, 2008, 04:26 PM
toddw607 toddw607 is offline
Authorized User
 
Join Date: Feb 2007
Location: Binghamton, NY, USA.
Posts: 88
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to toddw607 Send a message via Yahoo to toddw607
Default Using Regular Expressions in ASP.NET/VB.NET

Hi Everyone,
     I am trying to highlight an entire table row by using one parameter called Search_Str. Right now I can place the Search_Str within a regular expression and another program will highlight that string but I need to to highlight the entire table row that the keyword is contained in. Here are a few examples:
     1.) This will highlight only the string:
            Dim re as New RegEx (Search_Str)
     2.) This will highlight the entire table:
            Dim newTest as String
            newTest = String.Format("<[TableBody*>].*{0}.*</TableBody>", Search_Str)
            Dim re as New RegEx(newTest)

   and this is what the xml looks like that contains the table row:
Code:
             </TableBody>
      <TableBody wp:type="tablebody">
        <tr wp:type="tr_body">
        <TableCell wp:type="tablecell_body">
           <CellBodyRight wp:type="para" wp:id="1006521" 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: right; text-decoration: none; text-indent: 0pt; text-transform: none; vertical-align: baseline"> -1 </CellBodyRight> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBodyCaps wp:type="para" wp:id="1006523" 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="1006525" 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">
           <dot wp:type="para" wp:id="1006527" wp:style="display: block; color: #000000; font-style: normal; font-weight: normal; margin-bottom: 0pt; margin-left: 7pt; margin-right: 0pt; margin-top: 0pt; text-align: left; text-decoration: none; text-indent: -7pt; text-transform: none; vertical-align: baseline"> HOUSING, INDICATOR LIGHT </dot> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1006529" wp:style="display: block;"> 1 </CellBody> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1006531" wp:style="display: block;"> 111490001 </CellBody> 
        </TableCell>
        <TableCell wp:type="tablecell_body">
           <CellBody wp:type="para" wp:class="CellBody" wp:id="1006533" wp:style="display: block;"> LUMIN </CellBody> 
        </TableCell>
        </tr>
      </TableBody>


    Does anyone have any ideas that could get me started? TIA