Regex Select HtmlTags

  • Thread starter Thread starter Harry Leboeuf
  • Start date Start date
H

Harry Leboeuf

Hello,

I'm looking for a way to strip all html tags from a string.
I've found several good regular expressions that do that job.

I'm using <(.|\n)*?>,

But now i would like to keep the tag if betwene the < and the > appears some
text.
What is the goal, strip all html-tags and all anchors except if the anchor
goes to a specific site, then i still need the anchor in the stripped
string.

Anybody got a suggestion ??


Kind Regards
Harry
 
Hi Harry,

Do you need to strip out all the tags but keep certain anchor that links to
specific site in a string? If so, I think this will not be a good practice
to achieve it by Regex. Because you might have several long site names and
these might make the Regex hard to read and modify. It will be good to
write some code using String.Replace to achieve this, IMO. HTH.

Kevin Yu
Microsoft Online Community Support

============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top