I have this html:
<a href="http://www.site.com/">This is the content.</a>
I just need to get rid of the anchor tag html around the content text, so that all I end up with is “This is the content”.
Can I do this using Regex.Replace?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your regex:
<a[^>]+?>(.*?)</a>Check this Regex with the Regex-class and iterate through the result collection
and you should get your inner text.
Output:
The match expression in
()is stored in the second item ofmatch‘sGroupscollection (the first item is the whole match itself). Each expression in()gets into theGroupscollection. See the MSDN for further information.