This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

look for an reg expression to Remove HTML Tags

 
Hui Zhao
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

But IT seems to be wrong.
for ex.

I want to get

Thanks!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your regex is matching the entire tag, including everything between the "<" and ">", and replacing that with an empty String. But it sounds like you want to match "<" or "</" or ">" or "/>", and replace only these with empty Strings.

Does that make sense?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic