Quantcast
Channel: CodeProject Latest postings for ASP.NET
Viewing all articles
Browse latest Browse all 3938

regex replace with double quote

$
0
0
I stumped on this one. I want to replace everything in the test text with something else.
I have this
 
Dim expDIV AsString = "(^<div id=&quot;specialFooter&quot;|ID=&quot;specialFooter&quot;)(.*)(</div>)"Dim elementDIV As System.Text.RegularExpressions.MatchCollection = _
           Regex.Matches(p_MessageXHTML, expDIV)
 
to work this the test text
<div id="specialFooter" class="default_Wrapper_Footer">Anything can be here</div>
But I can't seem to get a match with my expression. I used the actual double quotes at first, then switched to the quot;.
 
Maybe I should html encoode the input for the match first, but then I would have to encode on the replace as well.
 
Any help or suggestion would be appreciated.

Viewing all articles
Browse latest Browse all 3938

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>