p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 1.0 and 1.1 Basics (http://p2p.wrox.com/forumdisplay.php?f=60)
-   -   Using Regular Expressions in ASP.NET/VB.NET (http://p2p.wrox.com/showthread.php?t=65732)

toddw607 February 5th, 2008 04:26 PM

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



All times are GMT -4. The time now is 01:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.