File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

look for an reg expression to Remove HTML Tags

 
Hui Zhao
Ranch Hand
Posts: 116
  • 0
  • 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
  • 0
  • 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